Oxygen Basic
Programming => Problems & Solutions => Topic started by: on October 09, 2018, 03:46:26 PM
-
The following code aborts execution:
wchar buffer[260] = "1234567890"
dim i as long
for i = len(buffer) to 1 step -1
if mid(buffer, i, 1) = wstring("5") or mid(buffer, i, 1) = wstring("4") then print i : exit for
next
-
Something is wrong with MID:
wchar buffer[260] = "C:\xxxx\xxx.bas"
dim i as long, pch as word at strptr(buffer)
for i = len(buffer) to 1 step -1
if pch[i] = asc(":") or pch[i] = asc("\") or pch[i] = asc("/") then
buffer = mid(buffer, i + 1)
print buffer + " " + i
exit for
end if
next
After buffer = mid(buffer, i + 1), buffer becomes empty.
-
Right also seems to have a problem.
left(buffer, 3) ' works
mid(buffer, 1, 3) ' works
mid(buffer, 1) ' does not work
right(buffer, 3) ' does not work
You need beta testers for unicode...