Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ElroyJetson on August 31, 2017, 02:16:19 PM
-
All,
I'm trying to create a custom datecode, with data pulled from the SDT0 structure. I have to assign the decade, the year, and the month a letter code, add some time and shift info, then put all of that into a string and stream it out to a printer. I'm having trouble figuring out how to isolate the decade number from the year.
Any hints greatly appreciated.......
-
Look at the string scripting. Help topic DMD0168. Possibly FMTINT() to extract the decade. Or use STRSUB to get the decade.
-
All,
I'm trying to create a custom datecode, with data pulled from the SDT0 structure. I have to assign the decade, the year, and the month a letter code, add some time and shift info, then put all of that into a string and stream it out to a printer. I'm having trouble figuring out how to isolate the decade number from the year.
Any hints greatly appreciated.......
(Year/10)%10 should give you the decade digit
-
Thanks, BobO!
Is there a way to delete the white space between strings when putting them into other strings? I am using strprint to put multiple short strings into a long string, but I cannot remove the white space between them....
-
Thanks, BobO!
Is there a way to delete the white space between strings when putting them into other strings? I am using strprint to put multiple short strings into a long string, but I cannot remove the white space between them....
Uncheck this...
-
That was not checked. Apparently strings aren't treated the same as numeric data. If you use numeric data, a space between elements does not go into the string, but string elements do.
-
That was not checked. Apparently strings aren't treated the same as numeric data. If you use numeric data, a space between elements does not go into the string, but string elements do.
I'm not seeing that. Is the space in the source string?
-
No, its not.
I have placed SS0 SS1 SS2 SS3 SS4 SS5 SS6 into SL1. Space between them or the STRPRINT wont accept them. When I view SL0, it appears there is a space between each short string.
-
Looks like this in Data View
-
Sorry........Clearly there are "Space separator inserted" on the SS.......... :-\
I should probably go home now........ ::)
-
Sorry........Clearly there are "Space separator inserted" on the SS.......... :-\
I should probably go home now........ ::)
Happens to us all.
-
In Data View, there is another display format for strings called Quoted, where you can see any leading/trailing white space that doesn't show up when viewed in ASCII format. The other benefit is that it can show you any control characters in quoted $-escape format (e.g. "$0D$0A" for CR/LF). ASCII would just show two dots (since you can't display a CR or LF).
So, I bet your SS strings in Data View in Quoted format would have looked like
"B "
"H "
"I "
"1 "
To change a Data View entry's display format, look at the drop-down combo box in the Data View's toolbar.