Global variable not working on web

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
citi1996
Posts: 4
Joined: Thu Dec 09, 2010 3:55 am

Global variable not working on web

Post by citi1996 » Thu Dec 09, 2010 4:20 am

This is my first attempt with Livecode (4.5.1), and I'm trying to convert an ASP.NET / MS SQL application to Livecode / Mysql. I have converted the MS SQL to MySQL migration and have built a prototype of part of the application. Everything works fine within the IDE (developing on a MAC), and if I create a standalone MAC app it works fine. My web app is failing however.

My entry screen has a combo box which the user selects from. I load this information into a global variable. The next cards are populated from mysql based on the value of the global variable. When I dump the global to the screen, I see it is the correct value on the entry card, but it is always 1 on the following cards.

This is the code that runs and fails:

Code: Select all

on opencard
   global gGIDX
   answer gGIDX
   put label of button tseason & "/1/1" into sDate  
   put label of button tseason & "/12/31" into eDate
     put getConnectID() into DbID

     put emtpy into theSQL

     put  "call ScoreByGrpPly(" & gGIDX &  ",'" & sdate & "','" & eDate & "');" into theSQL
I tried the application on both Safari and Firefox and the result is the same. I'm I missing something about global variables?

citi1996
Posts: 4
Joined: Thu Dec 09, 2010 3:55 am

Re: Global variable not working on web

Post by citi1996 » Tue Dec 14, 2010 3:44 am

Well I've all but given up on Livecode as a viable means of developing a replacement web app for my ASP.NET application. After building only 4 or 5 of the screens the revlet has ballooned to over 1MB already, so if I build the other 40+ screens, I'd expect the user would have to download a 10MB revlet each time they visited the site. Not very practical?

But the killer for me has been 3 things. First, on a mac anyways, I always have to move the browser window to make any of the controls initially selectable. While annoying for testing, it is impractical for production environments. Second the controls move on the screen. If I move the screen a large amount to get the controls recognized, content from combo boxes appear where the window used to be. Lastly, I don't know how long it would take to shakedown the web version of the application given the issues I've seen with global variables. With the initial problem I encountered, I tried the following code:

Code: Select all

  put last char of label of button "mygroups" into gGIDX
   answer gGIDX
   go to card "LeaderBoard"
The result of the answer was 2, yet on Leaderboard the answer was 1
change the code to

Code: Select all

   
   put 2 into gGIDX
   answer gGIDX
   go to card "LeaderBoard"
Now the answer is 2, and on Leaderboard it is 2!

With either code, the application works fine in the IDE.

Livecode has some amazing capabilities, however I believe the WEB functionality/capability is grossly overstated. I don't know that Real Studio Web edition will be any better, but after this experience I'm going to have to give it a try.

citi1996
Posts: 4
Joined: Thu Dec 09, 2010 3:55 am

Re: Global variable not working on web

Post by citi1996 » Mon Dec 20, 2010 2:27 pm

Well I built the same web app in Real Software's Web Studio. The control set is not as robust as Livecode, however the end product is a real web application. I really enjoy the Livecode environment and the language is spectacular for string processing. My requirements at this time necessitate web based solutions, and Livecode doesn't come anywhere close to what Web Studio produces (and it doesn't need a brower plugin). I'll continue to use Livecode for standalone applications, but for web projects the choice is Web Studio.

Post Reply