Oxygen Basic
		Programming => Problems & Solutions => Topic started by: Aurel on November 25, 2013, 10:08:04 AM
		
			
			- 
				Hi Charles...
Do you can confirm that quoted string ...like
elseif c$ = "IF"
or 
elseif c$ = "ENDIF"
is not detected , or in another words work like it is command IF or ENDIF...
is this a bug or something weird ????
			 
			
			- 
				
Hi Aurel,
String literals are never seen as commands
function f(string a)
if a="if"
  print 1
elseif a="elseif"
  print 2
elseif a="endif"
  print 3
else
  print 4
end if
end function
f "elseif" '2
f "else" '4
			 
			
			- 
				Thanks Charles...
I do something weird and mess-up my string extract function... ::)
			 
			
			- 
				
Watch out for multi-line strings. I have occasionally failed to close a quoted string, resulting in very strange behaviour. Code becomes string, and string becomes code...
			 
			
			- 
				
Watch out for multi-line strings. I have occasionally failed to close a quoted string, resulting in very strange behaviour. Code becomes string, and string becomes code...
thanks Charles on advice .. ;)
i will... :)
In my parser i forget to check string without empty space on the end of keyword like 
endif...
so i do this :
'get position of first empty space ----------
Epos = INSTR (LText," ")
IF EPos <> 0
   'get left from empty space
   c$ = Left(LText,Epos-1)
ELSE
  'get substring argument
  c$= Mid(Ltext,1,Len(Ltext))
END IF
c$ = Trim(c$)
c$=Ucase(c$)
and now work properly.. ;)