Page 1 of 2

Fields in Livecode

Posted: Wed Jan 19, 2022 3:26 am
by lemodizon
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

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 8:28 am
by richmond62
Do you mean you want COLUMNS in your field?

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 8:50 am
by lemodizon
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.

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 10:49 am
by Klaus
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

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 3:32 pm
by richmond62
Sans voila!

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

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 3:44 pm
by Klaus
row = line!
So your example shows 13 rows with 4 columns.

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 3:53 pm
by richmond62
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.

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 4:29 pm
by Klaus
I know and only wanted to show how to create another "column"
in an existing field containing text already.

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 5:31 pm
by richmond62
Aha.

I wonder exactly how one can do what Lemuel wants?

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 6:25 pm
by Klaus
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

Re: Fileds in Livecode

Posted: Wed Jan 19, 2022 6:35 pm
by jacque
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.

Re: Fileds in Livecode

Posted: Thu Jan 20, 2022 1:08 am
by lemodizon
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.

Re: Fileds in Livecode

Posted: Thu Jan 20, 2022 11:39 am
by Klaus
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

Re: Fileds in Livecode

Posted: Thu Jan 20, 2022 1:57 pm
by lemodizon
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


Re: Fileds in Livecode

Posted: Thu Jan 20, 2022 2:06 pm
by Klaus
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?