akajackson
akajackson
  • Threads: 2
  • Posts: 3
Joined: Jan 18, 2026
January 23rd, 2026 at 1:35:34 PM permalink
Greetings,

For those familiar with WinCraps & the scripting language, I am troubleshooting a script I've built. It passes the internal structure check & all of the logic works except for where I have given a checkstack a string value & assigned this checkstack a name. The name gets placed properly but the value remains at 0.
Script lines:
cs9.HandPhase = "None" :
csn9 = "Hand Phase" :

It successfully reads both of these and places "HandPhase" in the variable name field properly, but it is assigned a value of "0". If I change cs9.HandPhase = "Test" :,
reininitialize & run the script again, the value for cs9.HandPhase still remains at "0". If I change
cs9.HandPhase = 311 :,
reininitialize and rerun the script, the value for cs9.HandPhase is now "311". It seems to only like it when I assign numerical values to the CheckStack variable!?!

At later points in the script I try to change the value of cs9 to a different string (such as cs9.HandPhase = "P1" :) and it successfully reads the line of script but the value of cs9 doesn't change.

Any ideas or help is greatly appreciated!

Thank you!
AkaJackson
HighStakesJoe
HighStakesJoe
  • Threads: 0
  • Posts: 2
Joined: Feb 5, 2026
February 6th, 2026 at 4:27:21 PM permalink
It sounds like checkstack variables in WinCraps are numeric only for stored values, even though the name field accepts strings. In other words, the label can be text, but the underlying value is treated as a number, which would explain why strings always resolve to 0.
akajackson
akajackson
  • Threads: 2
  • Posts: 3
Joined: Jan 18, 2026
February 13th, 2026 at 5:40:23 AM permalink
It took me a minute to digest what you are saying, but now I get it. So now instead of trying to assign a permanent label name to a CS# variable and then giving this CS# a string value when it only wants numbers, I can just use the CS label name part as the "string accepting" variable itself. It took me a while to wrap my head around this, but I see how this works now!

Thank you for taking the time to explain this to me.! The Help file said a few times that WinCraps can work with strings as variables but I must have not read that thoroughly enough to understand that this only applies to the Label portion of the CS variable.

Kudos to you and thanks again!
Have a great day,
Corey
Steen
Steen
  • Threads: 0
  • Posts: 127
Joined: Apr 7, 2014
March 9th, 2026 at 5:58:00 PM permalink
Just saw this.

Think of a checkstack as having two properties: a value and a string (text)

You address each slightly different:
- To set a value use CheckStack
- To set a string use CheckStackName

You can use the full name or use the abbreviations CS and CSN

So, to set or change the name you could say:
csn9 = "Test"

To set or change the value you could say:
cs9 = 311

In order to make scripting more readable, you're allowed to enter an arbitrary suffix onto CS or CSN. So you can say:
cs9.HandPhase = 311
which is exactly the same as
cs9 = 311

These suffixes are not required nor must they remain consistent throughout the script or match the actual checkstacks' names. They're just little snippets of commentary you can use to identify the checkstacks' purposes.

When you try to set a checkstack value to a string value (as you did) then the program performs an automatic string-number conversion. And since the string you used did not begin with any numbers, it was converted to 0 (zero). If your string had begun with a number as in cs9 = "45Test" then cs9 would become 45 (the non-numeric characters stripped away).

Steen
  • Jump to: