I’m having trouble with the syntax for system variable offsets.
I’m naming the machines after their usage profile with a number appended to distinguish them. So for example, clients would be named named ProfileA1, ProfileB1, etc. I’m trying to include a .ini file with the profile name with no numbers. So in the “inc” folder I have ProfileA.ini, ProfileB.ini, ProfileC.ini. Then in my wnos.ini I have:
My thought was that it would read the terminal name starting on the right and skip one character (the number at the end of the terminal name). Then the unit number would be stripped off and all machines with the same profile name would pull the same .ini file.
I’ve tested out Include=$TN.ini and it works perfectly, but when I add the number to the terminal name and use the offset syntax, it doesn’t work.
I’ve read the system variable guide over and over and scoured the web for other information about the system variable syntax. Am I misunderstanding how it works?
Perfect, thank you! I hadn’t thought to do that. It turns out it works precisely the opposite of how I understood it. The offset is how many characters it reads from that direction, not how many it ignores. Now I can simplify my configuration considerably.
For any future seekers having trouble with the syntax:
As expected, &Left or &Right will make it read FROM that direction. The offset number states how many characters it will read before stopping. So &Left($TN,7) applied to the terminal name “wtSales09” will yield “wtSales,” while &Right($TN,7) would yield “Sales09.” Hope this clarifies for anyone else having trouble with this.