View previous topic :: View next topic |
Author |
Message |
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Tue Jun 28, 2016 10:11 am Post subject: Label that shows the value of a string |
|
|
Hello!
How do i create a label that changes after the value of a string?
For an example:
If the string value is: ceforum = change the label text to ceforum in the trainer
(the name is not specific, it can change to whatever, i just want to be able to see what name the client is.[/code]
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Jun 28, 2016 6:58 pm Post subject: |
|
|
Code: | UDF1.CELabel1.Caption = readString("address", 32) |
|
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Wed Jun 29, 2016 10:50 am Post subject: |
|
|
Zanzer wrote: | Code: | UDF1.CELabel1.Caption = readString("address", 32) |
|
This causes an error, i might just be really stupid but what am i doing wrong?
Code: | UDF1.CELabel1.Caption = readString("1B18034", 32) |
Its the correct name of the label
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Wed Jun 29, 2016 11:39 am Post subject: |
|
|
What's the error?
The error should not be caused by readString.
May 1st check if your ce version is up to date.
The version should be shown in main form caption.
If under 6.4(or 6.3?), the Object-oriented format (eg. UDF1.CELabel1 ==> form_name.edit_name) cannot be use.
It has to use old format (eg.
Code: | local ed = component_findComponentByName(UDF1,'CEEdit1')
setProperty(ed,'Text', readString("1B18034", 32)) |
In Zanzer's example, 'UDF1', 'CELabel1' are the default 1st form name and 1st label name created by ce's form designer.
May check if your form/label's name matched.
<oh, they are correct names.>
bye~
_________________
- Retarded. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Wed Jun 29, 2016 12:25 pm Post subject: |
|
|
panraven wrote: | What's the error?
The error should not be caused by readString.
May 1st check if your ce version is up to date.
The version should be shown in main form caption.
If under 6.4(or 6.3?), the Object-oriented format (eg. UDF1.CELabel1 ==> form_name.edit_name) cannot be use.
It has to use old format (eg.
Code: | local ed = component_findComponentByName(UDF1,'CEEdit1')
setProperty(ed,'Text', readString("1B18034", 32)) |
In Zanzer's example, 'UDF1', 'CELabel1' are the default 1st form name and 1st label name created by ce's form designer.
May check if your form/label's name matched.
<oh, they are correct names.>
bye~ |
I got 6.5,
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Wed Jun 29, 2016 12:28 pm Post subject: |
|
|
What's the error?
_________________
- Retarded. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Wed Jun 29, 2016 12:38 pm Post subject: |
|
|
panraven wrote: | What's the error? |
Description: |
|
Filesize: |
55.33 KB |
Viewed: |
8243 Time(s) |
|
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Wed Jun 29, 2016 12:51 pm Post subject: |
|
|
It said UDF1 is a nil value.
If UDF1 is the name of the form created by CE FORM DESIGNER, it should be shown on ce main menu/Table and its name under 'Create Form' .
The UDF1 than should be usable even your *.ct convert to *.cetrainer.
UDF1 should not be nil value in this case.
May check the form detail in the *.ct file.
bye~
_________________
- Retarded. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Wed Jun 29, 2016 12:56 pm Post subject: |
|
|
panraven wrote: | It said UDF1 is a nil value.
If UDF1 is the name of the form created by CE FORM DESIGNER, it should be shown on ce main menu/Table and its name under 'Create Form' .
The UDF1 than should be usable even your *.ct convert to *.cetrainer.
UDF1 should not be nil value in this case.
May check the form detail in the *.ct file.
bye~ |
The trainername is: CETrainer, if i swap out udf1 with cetrainer it works but nothing is writing on the label
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Wed Jun 29, 2016 1:00 pm Post subject: |
|
|
"... nothing is writing on the label"
Should be the readString return nil or an empty string,
which may be a process has not been attached, the address is not right (return nil),
or the string is actually an empty string.
added:
oops, I may misunderstood what 'nothing' means...
To see if the problem cause by readString, try replace 'readString...' with this
Code: | CETrainer.CELabel1.Caption = os.date('%X') |
The Label should change text for every click if every other thing except readString working.
_________________
- Retarded.
Last edited by panraven on Wed Jun 29, 2016 1:09 pm; edited 1 time in total |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Wed Jun 29, 2016 1:33 pm Post subject: |
|
|
panraven wrote: | "... nothing is writing on the label"
Should be the readString return nil or an empty string,
which may be a process has not been attached, the address is not right (return nil),
or the string is actually an empty string.
added:
oops, I may misunderstood what 'nothing' means...
To see if the problem cause by readString, try replace 'readString...' with this
Code: | CETrainer.CELabel1.Caption = os.date('%X') |
The Label should change text for every click if every other thing except readString working. |
Code: | CETrainer.CELabel1.Caption =os.date('%X')("1B18034", 32) |
So like this?
Sorry if im hard to help, i dont quite understand :c
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Wed Jun 29, 2016 2:03 pm Post subject: |
|
|
lothe23 wrote: |
Code: | CETrainer.CELabel1.Caption =os.date('%X') -- no these : ("1B18034", 32) |
So like this?
Sorry if im hard to help, i dont quite understand :c |
remove or comment out these : ("1B18034", 32)
It is just to isolate the problem between the ui and readString part.
_________________
- Retarded. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Sat Jul 02, 2016 8:58 am Post subject: |
|
|
bump
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sat Jul 02, 2016 12:48 pm Post subject: |
|
|
Code: | print(readString("1B18034", 32) or "bad address!") |
|
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Sat Jul 02, 2016 1:30 pm Post subject: |
|
|
Zanzer wrote: | Code: | print(readString("1B18034", 32) or "bad address!") |
|
how do i use this with my label?
|
|
Back to top |
|
|
|