• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Passing HHMMSS to a C BSFN and parsing that out.

FrankCLT

Active Member
Hello,

A value is being passed into the C BSFN in the form of HHMMSS... for example 105035. So mnHHMMSSStartTime would equal 105035. How would i be able to parse that into 3 fields like a Data Structure something like....

typedef Struct {
MATH_NUMERIC mnHHe; 10
MATH_NUMERIC mnMMe; 50
MATH_NUMERIC mnSSe; 35
} DS?????, *LP?????;


Any help would be greatly appreciated.....

Thank you,
FrankCLT







 

DSauve

Legendary Poster
Pseudo-code for you:

mnHHe = int(inputvalue/10000)
temp = inputvalue-mnHHe*10000
mnMMe = int(temp/100)
mnSSe = temp-mnMMe*100
 

FrankCLT

Active Member
Thank you....haven't tried it yet....but it seems i have attempted this before but i just cant seem to find the BSFN we've done this with. Am i mistaken about moving the Math_Numeric to a DS with 3 fields within in order to parse?

Thanks again,
FrankCLT
 

DSauve

Legendary Poster
If you want to create the DS to hold the three fields, that's fine, but you still are going to have to break it apart mathematically. The DS just by its own nature won't do that for you -- if that's what you're asking.
 

FrankCLT

Active Member
Understood....I will need to experiment with the MathDivide related variables...haven't done that very often.

Thank you,
FrankCLT
 

DSauve

Legendary Poster
You may also want to check out the NER N1300600, which does much of what you're looking for.
 
Top