PDA

View Full Version : Having Table Troubles... Help Please


coderanger
02-14-2009, 02:20 PM
Hi Gang, Long time no talk...

I'm getting back into creating some app's using autoplay media studio,
but I'm having an issue for some reason with creating a table. Please
see my code below:

-- Set up s_url table
s_url = {};

--Check to see if an error occurred...
error = Application.GetLastError();

if (error ~= 0) then

Dialog.Message("Error", "1 ".._tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);

else

s_ulr.SurfURL1 = Input.GetText("SurfURL1");
s_ulr.SurfURL2 = Input.GetText("SurfURL2");
s_ulr.SurfURL3 = Input.GetText("SurfURL3");

set_SurfURLs(
_SourceFolder.."\\system\\templates\\urldata.tew",

"{surl1}",s_ulr.SurfURL1,
"{surl2}",s_ulr.SurfURL2,
"{surl3}",s_ulr.SurfURL3,

_SourceFolder.."\\system\\urldata.tew"
)
end

--Check to see if an error occurred...
error = Application.GetLastError();
if (error ~= 0) then
Dialog.Message("Error", "2 ".._tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
Dialog.Message("Notice", "Your Surf URL Settings Have Been Updated!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

This code is in the "On Click" event for a button, but it keeps giving me
the following error message:

On Click, line 15: attempt to index global 's_url' (a nil value)

I have checked and re-checked everything, but I cannot figure out why I'm
getting this error message. Can someone please explain where I'm going
wrong here?

Thanks for any help you guys can offer,
Patrick

coderanger
02-14-2009, 02:55 PM
GAWD, I feel like an idiot!

I've been going 'round 'n 'round with this thing for
hours now, and I just found out what the issue is...

I have my created table: s_url

..and then I have this table (never created): s_ulr
trying to add data to a table that was never created in
the first place!

ha ha

Sorry for the stupid post,
Patrick

Derek
02-14-2009, 04:55 PM
lol .. i guess we've all done things like that!
One reason why it's good to copy/paste table names, variables etc.
Can save .. hours! of time :yes

Imagine Programming
02-14-2009, 07:42 PM
lol .. i guess we've all done things like that!
One reason why it's good to copy/paste table names, variables etc.
Can save .. hours! of time :yes

Erm... and.. days? :rolleyes

Big source + 3 char longh variable name (faulty ofcourse)... I wasn't really happy at that time xD...