Tab Panel Help

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Tab Panel Help

Post by warrenk » Tue Oct 28, 2008 8:52 pm

I have a panel with a 3 tabs on a card. I want to load the value of the fields from the 3 tabs into variables. How do I do this with panels.

ie.
put field "Contact 1" from "tab 1" of "Panel 1" into tVariable1
put field "Contact 2" from "tab 2" of "Panel 1" into tVariable2

I know the put commands above are incorrect...but I figured it would help to define what I was trying to do.

Thanks!
Warren

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Oct 28, 2008 10:46 pm

Hi Warren,

It is not clear to me what the problem is. To put the text of a field into a variable, just do this

Code: Select all

put fld 1 into myVar
If you want to do this depending on the tab, perhaps a switch control structure is useful:

Code: Select all

on menuPick theTab
  switch theTab
    case "Tab One"
      put fld "Tab One" into myTabOneVar
      break
   case "Tab Two"
      put fld "Tab Two" into myTabTwoVar
     break
   case "Tab Three"
      put fld "Tab Three" into myTabThreeVar
     break
   end switch
end menuPick
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Post by warrenk » Wed Oct 29, 2008 2:51 am

Mark,

Thanks for the explanation. I think I was trying to use the panel incorrectly.

Warren

Post Reply