largo_winch
25-09-2012, 10:42
hello, here two new questions from my side:
a) "string$ function"
FUNCTION TBMAIN () AS LONG
LOCAL msg AS STRING
LOCAL l AS INTEGER
msg = "thinBasic is a BASIC-Compiler."
l = LEN(msg)
MSGBOX msg
MSGBOX 0, STRING$(l, "-")
'how to set an underline for a string ?
' for example :
' "thinbasic is a compiler"
' ------------------------- '
END FUNCTION
b) loop question (similar to a problem I try to convert from freebasic to thinbasic): how I can use this command "continue" to follow the loop for three search routines? Can anybody check if my idea with "continue = 1" is a good way?
FUNCTION TBMAIN () AS LONG
END FUNCTION
'---------------------------------------------
FUNCTION filename(BYREF s AS STRING) AS STRING
'=============================================
DIM a AS LONG,b AS LONG, continue AS LONG
DO
a=b+1
'-- b=INSTR(a,s,":") : IF b THEN continue do ' original
b=INSTR(a,s,":") : IF b THEN continue =1'do
b=INSTR(a,s,"\") : IF b THEN continue =1'do
b=INSTR(a,s,"/") : IF b THEN continue =1'do
EXIT DO
LOOP
FUNCTION=MID$(s,a)
END FUNCTION
bye, largo
a) "string$ function"
FUNCTION TBMAIN () AS LONG
LOCAL msg AS STRING
LOCAL l AS INTEGER
msg = "thinBasic is a BASIC-Compiler."
l = LEN(msg)
MSGBOX msg
MSGBOX 0, STRING$(l, "-")
'how to set an underline for a string ?
' for example :
' "thinbasic is a compiler"
' ------------------------- '
END FUNCTION
b) loop question (similar to a problem I try to convert from freebasic to thinbasic): how I can use this command "continue" to follow the loop for three search routines? Can anybody check if my idea with "continue = 1" is a good way?
FUNCTION TBMAIN () AS LONG
END FUNCTION
'---------------------------------------------
FUNCTION filename(BYREF s AS STRING) AS STRING
'=============================================
DIM a AS LONG,b AS LONG, continue AS LONG
DO
a=b+1
'-- b=INSTR(a,s,":") : IF b THEN continue do ' original
b=INSTR(a,s,":") : IF b THEN continue =1'do
b=INSTR(a,s,"\") : IF b THEN continue =1'do
b=INSTR(a,s,"/") : IF b THEN continue =1'do
EXIT DO
LOOP
FUNCTION=MID$(s,a)
END FUNCTION
bye, largo