Expression continues past expected end

Started by kle2, February 06, 2025, 06:44:28 AM

Previous topic - Next topic

kle2

Hello everyone,

I tried to get a strsub for the tring below but got the error "Expression continues past expected end".  What did I do wrong on the below code?

******************
Line = '"admprdopcd01","2748","VSP","02/05/25","","71","6064"'
1stPortion = StrSub(Line, 1, 22)
******************

Thanks advance!
kle2

td

You can't begin a variable name with a numeric digit, i.e. 0 through 9. From the documentation:

'All WinBatch variables must start with an alphabetic character. They may contain but not start with numeric digits. If you name a variable something like, "30DaysAgo", you'll get an error message that says "Expression continues past expected end."'

https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/HTMLWIL_V__002.htm
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kle2

Quote from: td on February 06, 2025, 07:42:28 AMYou can't begin a variable name with a numeric digit, i.e. 0 through 9. From the documentation:

'All WinBatch variables must start with an alphabetic character. They may contain but not start with numeric digits. If you name a variable something like, "30DaysAgo", you'll get an error message that says "Expression continues past expected end."'

https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/HTMLWIL_V__002.htm

Awesome!  Thanks again for your help, TD!

snowsnowsnow

The assignment to Line is wrong, too.  What are those commas there for?

BTW, in future, you really should report which line triggered the error.  That information *IS* available in the error box that WB displays.