Cory Posted December 3, 2005 Report Share Posted December 3, 2005 I want to stop a loop when there are no more records. Eventually one of the text var’s will be null but I can’t find an elegant way to determine this. We have all these comparisons in the If Variable command but the “Null” option is missing. <g> I tried “=” then left the value empty but that doesn’t work. Is there a trick I’m missing here? So far the best I can come up with is to count the number of characters and stick that in an integer var. Then do an If Variable N1 = 0 which works but seems like an extra step. Any ideas? Quote Link to comment Share on other sites More sharing options...
joe Posted December 3, 2005 Report Share Posted December 3, 2005 Hello Cory! Not sure what your code looks like, but testing for an empty string variable does work. Here is an example: <IFVAR2:1:01:1:><TBOX4:T:4:CenterCenter000250000125:000:Empty Variable Variable T1 is empty!><ENDIF> There is a difference between an "empty" string and a NUL string in Macro Express as in all other programming languages, script or otherwise. NUL is a real character (ASCII 0) and it can be counted. If you have a string of 10 NUL characters, then the string length would show as 10. Quote Link to comment Share on other sites More sharing options...
Cory Posted December 3, 2005 Author Report Share Posted December 3, 2005 Dang, I tried that but it didn't work for me. I must have messed up in there somewhere. Interesting about null. Mathamatically null is nothing, devoid, empty. An empty set. I'll have to mind my words then when speaking in the programming world. Thanks for the edification! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.