Jump to content

subStr command not working after upgrading to 7.8


---
 Share

Recommended Posts

i have this program that was running on 6.8 version and now that we have upgraded to 7.8, i have nothing but issues with PCM

i have a file that contains point coordinates (file is attached)

  • i read the list
    • A = readListFile(MS_Curve_Points_Temp)                // read NX output

 

  • then i use subStr to seperate teh lines into individual string that i can easily phrase
    • D1 = subStr(A,1,1)

image.thumb.png.5600bbe39fc94bdadc60c6bce1f7b0f8.png

this was working up until we upgraded, now i am getting an error

image.thumb.png.40bc5440a3dcd056f37de9a4470e24cd.png

can someone please tell what has happened and what can i do to address this issue

i tried to convert "A" to text, but it didn't help

 

Greeley appreciate all the help 🙂

13382673_10_fof_zeiss_20_ms_x_Temp.para

Link to comment
Share on other sites

I haven't used Calypso 6.8, but I'm surprised sub string ever worked in this case. 

instead of D1=subStr(A,1,1)

Try: D1=getParameterNamed(A,1)

That should give you the first row of the list.

  • Thank you! 2
Link to comment
Share on other sites

Please sign in to view this quote.

that worked, thank you very much for the help

i just checked few other programs that run the same/similar codes in 6.8 and below and substr seems to be working on those version

i personally don't know much coding and use whatever gives me the results 😅

 

your solution just saved my day and i am thankful

 

Link to comment
Share on other sites

Glad I could help. I would be extremely cautious with the other programs using subStr though. If the context is similar to what you have shown above, I really can't fathom how they are working.

Link to comment
Share on other sites

this is the portion of the code and in 6.8 worked flawlessly

i guess i got lucky with a glitch or something 😁

 

Link to comment
Share on other sites

I must be missing something. When it's defined as: subStr(X,1,1), I'm under the impression it will only return the first character, not the first row/line.

For example.

image.png.9fe8e0cee198dd06b30711b32bee0e36.png

Maybe someone smarter than me can explain why that works in your attached topic?

However, don't fix what's not broken.

Link to comment
Share on other sites

i just ran it in two version to see what i get

it seems in my version, it doesn't see the "A" as string and still sees it as a list and returns "D1" also as a list

once i converted "A" to string it failed as you suggested

 

image.thumb.png.ac38b3fb8dad974a2c1c33b304515b28.png

 

image.thumb.png.02060849c01a9a3f774e5ace4625a738.png

Link to comment
Share on other sites

subStr must interact differently with a list than a string. But I get the same error from your first post when trying to parse through a list with subStr.

Maybe it has something to do with how the text file is encoded. 🤷‍♂️

Link to comment
Share on other sites

 Share

×
×
  • Create New...