File-Append, Call LoginUser
Jan 6, 2009 11:51:23 GMT -5
Post by veneff on Jan 6, 2009 11:51:23 GMT -5
Hello,
RunBasic build 2.44
I have two problems with this test program and one observation and one general question.
First the observation - If there are one or more tabs between the comment apostrophe and a statement, the apostrophe is effectively ignored and the statement is compiled.
The first problem is - what is wrong with this statement:
OPEN "ShoppersDebugFile.txt" FOR APPEND AS #DebugFile
I get the error:
Compile Error
Syntax error - OPEN "ShoppersDebugFile.txt" FOR APPEND AS #DebugFile
The second problem is - what is wrong with this statement:
CALL LoginUser
I get the run time error message from Err$ displayed in my error handler:
Message not understood: #for:produce:parameters:
The error occurred when this call was executed. The first statement in the Subroutine LoginUser was not executed.
This test program was boiled down from a MUCH larger program. I have had no problems calling subroutines with no arguments. So, I assume is has to do with the SUB name LoginUser.
And finally, the general question - Can I use a variable in a DIM statement? And can I reissue a DIM for a variable in order to change its size? I notice that there is no REDIM statement. Such as:
a = 100
DIM a$(a)
b = 20
DIM a$(b)
c = 200
DIM a$(c)
Thanks for any help!
Vance
Here is the program:
'Run Basic program GenerateShoppingList
GLOBAL TRUE
TRUE = -1
GLOBAL FALSE
FALSE = 0
GLOBAL DebugOn
DebugOn = TRUE
GLOBAL AnErrorOccurred
AnErrorOccurred = FALSE
GLOBAL ErrorMessage$
ErrorMessage$ = ""
GLOBAL LocationMarker
GLOBAL DebugFileOpened
DebugFileOpened = FALSE
'OPEN "ShoppersDebugFile.txt" FOR APPEND AS #DebugFile
'DebugFileOpened = TRUE
ON ERROR GOTO [ErrorHandler]
CALL DebugMsg "Starting GenerateShoppingList program"
'CALL GetMajorCatagoryList
LocationMarker = 13
CALL LoginUser
LocationMarker = 1
[EndCurrentProcedure]
IF (AnErrorOccurred) THEN
CALL DebugMsg ErrorMessage$
END IF
CALL DebugMsg ""
CALL DebugMsg "Program Completed"
END
[ErrorHandler]
CALL DebugMsg ""
CALL DebugMsg "Error string is " + chr$(34) + Err$ + chr$(34)
CALL DebugMsg "Error number is ";Err;", after LocationMarker ";LocationMarker
[ErrorExit]
CALL DebugMsg ""
CALL DebugMsg ErrorMessage$
[EndProgram]
END
SUB DebugMsg DebugMsg$
IF (DebugOn) THEN
IF (DebugFileOpened) THEN
PRINT #DebugFile, DATE$("mm/dd/yyyy");" ";TIME$();" ";DebugMsg$
ELSE
PRINT DATE$("mm/dd/yyyy");" ";TIME$();" ";DebugMsg$
END IF
END IF
END SUB
SUB LoginUser
LocationMarker = 12
CustomerUserName$ = ""
[LoginUser]
[ShopperHasLoggedIn]
END SUB
RunBasic build 2.44
I have two problems with this test program and one observation and one general question.
First the observation - If there are one or more tabs between the comment apostrophe and a statement, the apostrophe is effectively ignored and the statement is compiled.
The first problem is - what is wrong with this statement:
OPEN "ShoppersDebugFile.txt" FOR APPEND AS #DebugFile
I get the error:
Compile Error
Syntax error - OPEN "ShoppersDebugFile.txt" FOR APPEND AS #DebugFile
The second problem is - what is wrong with this statement:
CALL LoginUser
I get the run time error message from Err$ displayed in my error handler:
Message not understood: #for:produce:parameters:
The error occurred when this call was executed. The first statement in the Subroutine LoginUser was not executed.
This test program was boiled down from a MUCH larger program. I have had no problems calling subroutines with no arguments. So, I assume is has to do with the SUB name LoginUser.
And finally, the general question - Can I use a variable in a DIM statement? And can I reissue a DIM for a variable in order to change its size? I notice that there is no REDIM statement. Such as:
a = 100
DIM a$(a)
b = 20
DIM a$(b)
c = 200
DIM a$(c)
Thanks for any help!
Vance
Here is the program:
'Run Basic program GenerateShoppingList
GLOBAL TRUE
TRUE = -1
GLOBAL FALSE
FALSE = 0
GLOBAL DebugOn
DebugOn = TRUE
GLOBAL AnErrorOccurred
AnErrorOccurred = FALSE
GLOBAL ErrorMessage$
ErrorMessage$ = ""
GLOBAL LocationMarker
GLOBAL DebugFileOpened
DebugFileOpened = FALSE
'OPEN "ShoppersDebugFile.txt" FOR APPEND AS #DebugFile
'DebugFileOpened = TRUE
ON ERROR GOTO [ErrorHandler]
CALL DebugMsg "Starting GenerateShoppingList program"
'CALL GetMajorCatagoryList
LocationMarker = 13
CALL LoginUser
LocationMarker = 1
[EndCurrentProcedure]
IF (AnErrorOccurred) THEN
CALL DebugMsg ErrorMessage$
END IF
CALL DebugMsg ""
CALL DebugMsg "Program Completed"
END
[ErrorHandler]
CALL DebugMsg ""
CALL DebugMsg "Error string is " + chr$(34) + Err$ + chr$(34)
CALL DebugMsg "Error number is ";Err;", after LocationMarker ";LocationMarker
[ErrorExit]
CALL DebugMsg ""
CALL DebugMsg ErrorMessage$
[EndProgram]
END
SUB DebugMsg DebugMsg$
IF (DebugOn) THEN
IF (DebugFileOpened) THEN
PRINT #DebugFile, DATE$("mm/dd/yyyy");" ";TIME$();" ";DebugMsg$
ELSE
PRINT DATE$("mm/dd/yyyy");" ";TIME$();" ";DebugMsg$
END IF
END IF
END SUB
SUB LoginUser
LocationMarker = 12
CustomerUserName$ = ""
[LoginUser]
[ShopperHasLoggedIn]
END SUB