News:

  • June 28, 2026, 06:56:52 AM

Login with username, password and session length

Author Topic: Getting data from SDT structure  (Read 11730 times)

ElroyJetson

  • Full Member
  • ***
  • Posts: 36
Getting data from SDT structure
« 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.......

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: Getting data from SDT structure
« Reply #1 on: August 31, 2017, 02:49:13 PM »
Look at the string scripting.  Help topic DMD0168.  Possibly FMTINT() to extract the decade.  Or use STRSUB to get the decade.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Getting data from SDT structure
« Reply #2 on: August 31, 2017, 03:20:45 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.......

(Year/10)%10 should give you the decade digit
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ElroyJetson

  • Full Member
  • ***
  • Posts: 36
Re: Getting data from SDT structure
« Reply #3 on: September 01, 2017, 09:28:50 AM »
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....

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Getting data from SDT structure
« Reply #4 on: September 01, 2017, 09:33:08 AM »
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...
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ElroyJetson

  • Full Member
  • ***
  • Posts: 36
Re: Getting data from SDT structure
« Reply #5 on: September 01, 2017, 09:44:40 AM »
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.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Getting data from SDT structure
« Reply #6 on: September 01, 2017, 09:54:27 AM »
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?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ElroyJetson

  • Full Member
  • ***
  • Posts: 36
Re: Getting data from SDT structure
« Reply #7 on: September 01, 2017, 09:59:30 AM »
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.

ElroyJetson

  • Full Member
  • ***
  • Posts: 36
Re: Getting data from SDT structure
« Reply #8 on: September 01, 2017, 10:07:27 AM »
Looks like this in Data View

ElroyJetson

  • Full Member
  • ***
  • Posts: 36
Re: Getting data from SDT structure
« Reply #9 on: September 01, 2017, 10:12:31 AM »
Sorry........Clearly there are "Space separator inserted" on the SS.......... :-\

I should probably go home now........ ::)
« Last Edit: September 01, 2017, 10:18:10 AM by ElroyJetson »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Getting data from SDT structure
« Reply #10 on: September 01, 2017, 10:22:02 AM »
Sorry........Clearly there are "Space separator inserted" on the SS.......... :-\

I should probably go home now........ ::)

Happens to us all.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Getting data from SDT structure
« Reply #11 on: September 01, 2017, 10:37:18 AM »
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.