Fields in Livecode

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Fields in Livecode

Post by lemodizon » Wed Jan 19, 2022 3:26 am

Hi everyone,

Good day.

How to do this in livecode see below the picture.

here's my code

Code: Select all

on mouseUp
   put fld "OrderNumber" into tForReleaseOrder
   put tForReleaseOrder & cr after fld "ForCollectFld" 
   
end mouseUp
Attachments
Fleids.JPG
Last edited by lemodizon on Mon May 23, 2022 9:23 am, edited 1 time in total.
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Fileds in Livecode

Post by richmond62 » Wed Jan 19, 2022 8:28 am

Do you mean you want COLUMNS in your field?

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Re: Fileds in Livecode

Post by lemodizon » Wed Jan 19, 2022 8:50 am

Hi richmond62,

kinda like that but the twist here after the last number display which is "70". it will create another column and display other numbers.

Thanks richmond62.
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fileds in Livecode

Post by Klaus » Wed Jan 19, 2022 10:49 am

Hi Lemodizon,

why not set a tabstop and add new columns with a TAB to the same field?

Code: Select all

...
repeat with i = 1 to the num of lines of fld 1
  put TAB & your_value_here after line i of fld 1
end repeat
...
Et voila, columns! :-)
Know what I mean?


Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Fileds in Livecode

Post by richmond62 » Wed Jan 19, 2022 3:32 pm

Sans voila!

Because:
-
Screen Shot 2022-01-19 at 4.30.37 PM.png
-
The result is ROWS, and NOT COLUMNS.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fileds in Livecode

Post by Klaus » Wed Jan 19, 2022 3:44 pm

row = line!
So your example shows 13 rows with 4 columns.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Fileds in Livecode

Post by richmond62 » Wed Jan 19, 2022 3:53 pm

direxion.png
-
My recent attempt, based on your suggestion, does NOT result in what Lemuel wants.

This is what he wants:
-
Screen Shot 2022-01-19 at 4.59.22 PM.png
-
Mockup made in LibreOffice.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fileds in Livecode

Post by Klaus » Wed Jan 19, 2022 4:29 pm

I know and only wanted to show how to create another "column"
in an existing field containing text already.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Fileds in Livecode

Post by richmond62 » Wed Jan 19, 2022 5:31 pm

Aha.

I wonder exactly how one can do what Lemuel wants?

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fileds in Livecode

Post by Klaus » Wed Jan 19, 2022 6:25 pm

Lemodizon,

do your numbers come from ONE field and you want them to display in columns in another field
or do you have several fields that you want to display in different columns in the same field?


Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Fileds in Livecode

Post by jacque » Wed Jan 19, 2022 6:35 pm

The easiest way would be to group three fields and scroll the group. Get the number of lines in the data and div by 3. Put lines 1 to x into fld 1, the next set of x lines into fld 2 and the final set into fld 3.

If only one field is required then put the first set into the field, then repeat for the next set putting a tab before the value after each line in the field. Do the same for the third set.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Re: Fileds in Livecode

Post by lemodizon » Thu Jan 20, 2022 1:08 am

Klaus wrote:
Wed Jan 19, 2022 6:25 pm
Lemodizon,

do your numbers come from ONE field and you want them to display in columns in another field
or do you have several fields that you want to display in different columns in the same field?


Best

Klaus
Hi Klaus,

Yes it come from ONE field only. in my picture after i entered the number 70 it will create a column or tab near the number 150 but using only one filed.
Attachments
Fleids.JPG
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fileds in Livecode

Post by Klaus » Thu Jan 20, 2022 11:39 am

Hi lemodizon,
in my picture after i entered the number 70 it will create a column or tab near the number 150 but using only one field.
YOU entered? I thought this should be done completely via script?

So you have fixed values (70, 30, 60) after which the "column break" should happen?
Or any other "rule" for this?

And maybe you can post the content of that source field here, so we could experiment a bit?


Best

Klaus

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Re: Fileds in Livecode

Post by lemodizon » Thu Jan 20, 2022 1:57 pm

Klaus wrote:
Thu Jan 20, 2022 11:39 am
Hi lemodizon,
in my picture after i entered the number 70 it will create a column or tab near the number 150 but using only one field.
YOU entered? I thought this should be done completely via script?

So you have fixed values (70, 30, 60) after which the "column break" should happen?
Or any other "rule" for this?

And maybe you can post the content of that source field here, so we could experiment a bit?


Best

Klaus


Hi Klaus,

Good day.

Sorry this is the sample stack picture that i'm practicing. it has a enter button.

Code: Select all

on mouseUp
   if fld "numberFld" is empty then
      beep
      Answer error "Please enter a Number. Thanks!" 
   else 
      put fld "numberFld" into tMyNumber
      put tMyNumber & cr after fld "ForReleasingFld" 
      
      put empty into fld "numberFld"
   end if
end mouseUp

Attachments
Fleids.JPG
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fileds in Livecode

Post by Klaus » Thu Jan 20, 2022 2:06 pm

We need more info, so I repeat:
So you have fixed values (70, 30, 60) after which the "column break" should happen?
Or any other "rule" for this?

And maybe you can post the content of that source field here, so we could experiment a bit?

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”