Variables and Definition Errors
Moderator: Rathinagiri
Variables and Definition Errors
Hi all. I wasn't sure how to word a search enquiry for this one so I thought I'd post something here in the hope I can be put on the right track.
I have created an input screen using LABELs and TEXTBOXes. A number of variables have been applied to the expected entries. I want to save the results of the input to a database and then reload the empty TEXTBOXes ready for the next entry.
Initially I'd be happy if someone could guide me towards how to reuse the TEXTBOXes without closing the entry screen and reloading it. If there is a SAMPLE someone knows of I'd be happy to work through it.
To link this enquiry with the subject, I've been getting errors relating to the definitions of LABELs, BUTTONs & Variables that have already been defined. I've added a "RELEASE ALL" command but the program won't run yet because of other errors I'm working through.
I've been hesitant to upload the source because it is a fair size but will zip it and upload it if you need me to.
Regards,
Alan
I have created an input screen using LABELs and TEXTBOXes. A number of variables have been applied to the expected entries. I want to save the results of the input to a database and then reload the empty TEXTBOXes ready for the next entry.
Initially I'd be happy if someone could guide me towards how to reuse the TEXTBOXes without closing the entry screen and reloading it. If there is a SAMPLE someone knows of I'd be happy to work through it.
To link this enquiry with the subject, I've been getting errors relating to the definitions of LABELs, BUTTONs & Variables that have already been defined. I've added a "RELEASE ALL" command but the program won't run yet because of other errors I'm working through.
I've been hesitant to upload the source because it is a fair size but will zip it and upload it if you need me to.
Regards,
Alan
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Variables and Definition Errors
Hi Alan,
Can you make a small sample with the errors you are getting?
You can also share the error logs.
Can you make a small sample with the errors you are getting?
You can also share the error logs.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Variables and Definition Errors
Hi Alan
Control names are public variable throughout project and they should be unique;
so you need give name to they like this way:
@ ..., ... BUTTON MyButton_1 ...
@ ..., ... BUTTON MyButton_2 ...
instead of :
@ ..., ... BUTTON MyButton ...
@ ..., ... BUTTON MyButton ...
This may be your problem.
Happy HMG'ing
Viva INTERNATIONAL HMG
Re: Variables and Definition Errors
I would, Rathinagiri, but I can't see how to upload a file. And esgici, my problem is I need to reuse the buttons and labels on the screen but because they have already been defined, I'm not allowed to. It's more of a screen layout issue so I don't mind releasing the values and reapplying them, as long as the screen looks the same and the same variables can accept new values. By the way, a little off topic (very off topic acutally), I loved some of the Turkish TV programs available on Netflix in Australia, with English subtitles of course!
Alan
Alan
- dragancesu
- Posts: 926
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Variables and Definition Errors
Look atachment program in topic Indexing DBF
It's all what you need
It's all what you need
Re: Variables and Definition Errors
Dragan, I can see that you uploaded a zip file but I can't see how you did it. I can't find anything to click on to allow a file upload.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Variables and Definition Errors
Sadly we can't change rules posed by compiler and libraries
I'm glad that good watch:)I loved some of the Turkish TV programs available on Netflix in Australia, with English subtitles of course!
Viva HMG
Viva INTERNATIONAL HMG
Re: Variables and Definition Errors
Hi,
Serge Girard provided the following code for me, it should solve your problem:
If the control is already defined, you simply release it and now you can define it again.
Regards Robert
Serge Girard provided the following code for me, it should solve your problem:
Code: Select all
function weiter
SetProperty('Del_1', 'Grid_1','Visible', .F.)
go Del_1.Grid_1.RecNo
cPERSNR := bbpers->persnr
cNAME := bbpers->name
cVname:= bbpers->vname
SetProperty('Del_1', 'Grid_1','Visible', .T.)
Del_1.Grid_1.SetFocus
IF IsControlDefined ('X1' , 'Del_1' )
DoMethod ('Del_1' , 'X1' , 'Release' )
ENDIF
IF IsControlDefined ('X2' , 'Del_1' )
DoMethod ('Del_1' , 'X2' , 'Release' )
ENDIF
IF IsControlDefined ('X4' , 'Del_1' )
DoMethod ('Del_1' , 'X4' , 'Release' )
ENDIF
aKZ:={'N','J'}
DEFINE TEXTBOX X1
PARENT Del_1
ROW 850
COL 10
WIDTH 200
HEIGHT 25
VALUE cPERSNR+' '+alltrim(cNAME)+' '+alltrim(cVname)
FONTCOLOR BLACK
TOOLTIP ' '
TABSTOP .T.
READONLY .T.
END TEXTBOX
DEFINE COMBOBOX X2
PARENT Del_1
ROW 850
COL 340
WIDTH 60
ITEMS aKZ
VALUE 1
on enter weiter()
END COMBOBOX
Regards Robert
Re: Variables and Definition Errors
Thanks again people. I certainly feel very slow tonight. I haven't been using the full editor today so that's how I missed it.
This program is unfinished so not all of the menu buttons work. It loads the main menu and loads "Add New Music" but none of the other menu items work, as well as the 3 buttons at the bottom. Some of the labels aren't displaying properly either but I know I can fix that as I work on it.
I want to create code that will respond if the first box is left empty. I'm not sure how to code it so that each time there is a response to a textbox, the value of the variable is assessed and an action taken before moving on to the next textbox.
I don't need anyone to work on the rest of it as I want the exercise of doing it myself so I can learn. But if I can get some pointers on this "Add" menu item, that should help me.
Thanks again everyone.
Alan
This program is unfinished so not all of the menu buttons work. It loads the main menu and loads "Add New Music" but none of the other menu items work, as well as the 3 buttons at the bottom. Some of the labels aren't displaying properly either but I know I can fix that as I work on it.
I want to create code that will respond if the first box is left empty. I'm not sure how to code it so that each time there is a response to a textbox, the value of the variable is assessed and an action taken before moving on to the next textbox.
I don't need anyone to work on the rest of it as I want the exercise of doing it myself so I can learn. But if I can get some pointers on this "Add" menu item, that should help me.
Thanks again everyone.
Alan