[Ro...] Posted Tuesday at 01:35 PM Share Posted Tuesday at 01:35 PM Hi, i have a .txt that im reading with readListFile() This is what it contains: With this code: offtsetCoordinates = readListFile(offsetFile) ballFinderOffsetX = (val(getParameterNamed(offtsetCoordinates,1))/1000) ballFinderOffsetY = (val(getParameterNamed(offtsetCoordinates,2))/1000) ballFinderOffsetZ = (val(getParameterNamed(offtsetCoordinates,3))/1000) coordsys = getParameterNamed(offtsetCoordinates,4) I get the two "0" values correctly because i guess they are integers and the rest is just "". I could make the file comma seperated and then use offSetStuff=offsetFile.asFilename.contentsOfEntireFile xOffset = val(strElement(1,",",offSetStuff))) yOffset = val(strElement(2,",",offSetStuff))) zOffset = val(strElement(3,",",offSetStuff))) coordSys = val(strElement(4,",",offSetStuff))) But i dont want that tbh.  Is there a way to use getParamteterNamed() for that? Link to comment Share on other sites More sharing options...
[No...] Posted Tuesday at 02:17 PM Share Posted Tuesday at 02:17 PM (edited) What exactly ist it that doesn't work with your first code? If I simulate it, I get 0, 0 and -0.1d What exactly did you get and what did you expect instead? I never had any problems reading mixed lists with getParameterNamed() Edited Tuesday at 02:19 PM Link to comment Share on other sites More sharing options...
[He...] Posted Tuesday at 06:54 PM Share Posted Tuesday at 06:54 PM offtsetCoordinates = readListFile(offsetFile) ballFinderOffsetX = (val(getParameterNamed("offtsetCoordinates",1))/1000) ballFinderOffsetY = (val(getParameterNamed("offtsetCoordinates",2))/1000) ballFinderOffsetZ = (val(getParameterNamed("offtsetCoordinates",3))/1000) coordsys = getParameterNamed("offtsetCoordinates",4) Link to comment Share on other sites More sharing options...
[Ro...] Posted yesterday at 08:02 AM Author Share Posted yesterday at 08:02 AM (edited) Hi Norbert, here u see what im getting here (ignore the parenthesis in front of val(), it doesnt change the result) And i swear, yesterday when testing the same code got me "" for coordsys = getParameterNamed("offtsetCoordinates",4) Edited yesterday at 08:05 AM Link to comment Share on other sites More sharing options...
[No...] Posted yesterday at 10:29 AM Share Posted yesterday at 10:29 AM (edited) I used the format from your original post (no "" around offsetCoordinates) and still got -0.1d for the 3rd value (-100.0). I used display() for output. Edited yesterday at 10:30 AM Link to comment Share on other sites More sharing options...
[Ro...] Posted yesterday at 11:29 AM Author Share Posted yesterday at 11:29 AM I guess im going to install the latest sp and see if it still behaves like that Link to comment Share on other sites More sharing options...
[Ro...] Posted yesterday at 12:05 PM Author Share Posted yesterday at 12:05 PM I restarted Calypso 20000 times during testing with no influence on the result. After restarting the PC to install the new sp its now working as intended Link to comment Share on other sites More sharing options...
[Ri...] Posted yesterday at 12:13 PM Share Posted yesterday at 12:13 PM Just blame Microsoft. 🤣 Link to comment Share on other sites More sharing options...
[Ro...] Posted 12 hours ago Author Share Posted 12 hours ago Okay, its not working again. It takes floats now, but the strings stay the same... String just become an empty string 😞 Link to comment Share on other sites More sharing options...
[Er...] Posted 11 hours ago Share Posted 11 hours ago (edited) Make sure you file is encoded with UTF-8, other encodings can cause issues with readListFile() and the regular filestream. If I recall correct 7.8 was the first version to use a more roboust filestream. Edited 11 hours ago 1 Link to comment Share on other sites More sharing options...
[Ro...] Posted 8 hours ago Author Share Posted 8 hours ago You gave me hope for a second, but unfortunately my files are encoded with UTF-8 😞 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in