Having trouble getting LoadString to work

Monkey Forums/Monkey Programming/Having trouble getting LoadString to work

NoOdle(Posted 2011) [#1]
I have tried to get this command to load a text file I had on my macbook. I have created the .data folder in my projects folder with the same name at the start. When I build my app it does copy this file into the builds .data file so that seems ok.

I am unable to see or retrieve the contents though. Are there any tips to doing this? If anyone has a working example that would be great.

Can't see what I've missed!


Raz(Posted 2011) [#2]
what's the extension for the file you are trying to open?


NoOdle(Posted 2011) [#3]
Just a simple text file .txt


anawiki(Posted 2011) [#4]
post your code here


NoOdle(Posted 2011) [#5]
erm I basically used the example, hacked it a little bit so that it just displays the loadstring result, but i don't see anything.

Im pretty sure I'm missing something.


therevills(Posted 2011) [#6]
Well post your code so we can help you ;)


NoOdle(Posted 2011) [#7]
Yea sorry I should have posted the code but I didn't dare do it yesterday as I was very drunk and likely to make a tit out of myself!

I have just tried another test with a different txt file and it now works... so I'm a little baffled, but rather happy.





therevills(Posted 2011) [#8]
You need to SetUpdateRate in the OnCreate Method.


hardcoal(Posted 2011) [#9]
OMG ! how can anyone guess that?


therevills(Posted 2011) [#10]
Its required for any mojo app to run... I think it should be defaulted to 60 so you dont need to set it yourself, unless you need to change it.

@NoOdle - I notice that you have added the SetUpdateRate now, did it work?


NoOdle(Posted 2011) [#11]
the set update rate actually didn't make any different to the loaded string, my text file was corrupt, which it didn't like. :P