OK, first off I want to declare that I am VERY wet-behind-the-ears here with VFP. I have taken courses for C++ and Java, but that is the extent of my programming knowledge. Anyways, back to the problem at hand. I have a form, and one of the text boxes on this form is called SERIAL_NO1 and is used to store VIN numbers for cars. Right now, I am just trying to write the code that will check the 9th position of the string and if it does not equal a certain number/letter (8 in this case) then I want to display an error. Here's the code that I have written:
cVinString=ThisForm.SERIAL_NO1
cMessageText='VIN error'
cMessageTitle='VIN Check'
nDialogType=48
IF SUBSTR(cVinString,9,1) != '8'
MESSAGEBOX(cMessageText,nDialogType,cMessageTitle)
ENDIF
The error message I get is that there is "Function argument value, type, or count is invalid." The SERIAL_NO1 field is tied to a database, but if possible, the check needs to be done from the textbox itself because users will be adding new cars through this page, and new cars aren't in the database yet. Plesae help me out, or atleast try to explain to me what has gone wrong.
*****************************************
OK, after finally figuring out how to read through and actually get some information from the Debugger, I have concluded that cVinString is being stored in memory as an object, not a Character-type, so what do I need to do to change that? Hopefully this helps some
cVinString=ThisForm.SERIAL_NO1
cMessageText='VIN error'
cMessageTitle='VIN Check'
nDialogType=48
IF SUBSTR(cVinString,9,1) != '8'
MESSAGEBOX(cMessageText,nDialogType,cMessageTitle)
ENDIF
The error message I get is that there is "Function argument value, type, or count is invalid." The SERIAL_NO1 field is tied to a database, but if possible, the check needs to be done from the textbox itself because users will be adding new cars through this page, and new cars aren't in the database yet. Plesae help me out, or atleast try to explain to me what has gone wrong.
*****************************************
OK, after finally figuring out how to read through and actually get some information from the Debugger, I have concluded that cVinString is being stored in memory as an object, not a Character-type, so what do I need to do to change that? Hopefully this helps some