Hello, I have a background and programming and scripting language but I am new to Lua, I have a feeling it’s probably something really minor and amateur.
Imagine i have file called “dircheck” with no extension on a sever and the contents are “TextLoaded123”
I am trying to load those contents into a variable in my app. The response prints correctly the contents of the file but I can’t seem to get it into the variable. The print results for the variable at the end are still the initial value I gave it which is “test”
[lua]local loadedHTMLtext = “test”
local function networkListener( event )
if ( event.isError ) then
print( “Network error!”)
else
loadedHTMLtext = event.response
print ( "RESPONSE: " … event.response )
end
end
network.request( “http://sample.com/sampledir/dircheck”, “GET”, networkListener )
print ( loadedHTMLtext )[/lua]
Anyone know what I’m doing wrong?
Thank you in advance for your help! I feel embarrassed even having to ask [import]uid: 93934 topic_id: 15832 reply_id: 315832[/import]