HP Forums
Emu48 Locate Character in a String - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: Emu48 Locate Character in a String (/thread-16525.html)



Emu48 Locate Character in a String - MNH - 03-25-2021 01:37 AM

Is there an Emu48 function similar to Java's indexOf() method? I can load a text file

7,5000.0000,5000.0000,5/8 IRC SSMC LB 2108
8,5400.0000,5000.0000,5/8 IRC SSMC LB 2108
9,5400.0000,5400.0000,4X4 CM
10,5000.0000,5400.0000,4X4 CM

into the Emu48, which appears on the stack as a string with a CR character at the end of each line.
I figure I can remove a substring of the string at the CR character and store each substring in a list. Speaking of CR characters, how come there are so many of them in CHARACTERS 0-63? How do I know which CR character is being used? My list of lists will be in the form

{ { 7.0000
[ 5000.0000 5000.0000 ]
"5/8 IRC SSMC LB 2108"
} { 8.0000
[ 5400.0000 5000.0000]
"5/8 IRC SSMC LB 2108"
} }

and so on.


RE: Emu48 Locate Character in a String - Eric Rechlin - 03-25-2021 02:58 AM

This isn't an Emu48 question. It's a question about whatever calculator you are emulating with it (you didn't specify which makes it difficult to help you), so this should be asked in the General forum instead.


RE: Emu48 Locate Character in a String - MNH - 03-25-2021 09:25 AM

(03-25-2021 02:58 AM)Eric Rechlin Wrote:  This isn't an Emu48 question.
Okay. Will reword and place in the appropriate forum.