Variables in Dialog-Checkbox don't work anymore

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Variables in Dialog-Checkbox don't work anymore

Post by migro » Wed Oct 12, 2005 3:14 pm

Hi,

in nearly all off my scripts the Checkboxes in the dialogs are prefilled with the content from a ini-file or def. values. If I'm using msched > 7.4 seems that it dont work anymore.

Codesample:


LibFunc>user32,GetSystemMetrics,screen_width,0
LibFunc>user32,GetSystemMetrics,screen_height,1
Let>width=450
Let>height=433
Let>left={(%screen_width% div 2) - (%width% div 2)}
Let>top={(%screen_height% div 2) - (%height% div 2)}

Dialog>MapTest
Caption=MapCon - INI zu Reg Konverter
Top=%top%
Width=%width%
Left=%left%
Height=%height%
Label=Anwendung:,16,8
Label=Bildpfad,232,32
Label=** Für jeden TS-Client durchführen,16,384
Label=____________________________________________________________________,16,344
Label=____________________________________________________________________,16,176
Label=* Ausführung nur einmal notwendig,16,368
Label=Datenbank:,232,8
Label=DSN:,16,32
Edit=AppPath,96,8,113,AppPath
Edit=DBPath,312,8,113,DBPath
Button=OK,272,368,75,25,1
Button=Abbrechen,352,368,75,25,2
CheckBox=SIDserNr,SIDEXIS Seriennummer eintragen,16,96,193,%SIDserNr%
Edit=SIDNr,232,96,193,SIDNr
CheckBox=Praxis,Praxisname eintragen,16,120,193,%Praxis%
Edit=PraxName,232,120,193,PraxName
CheckBox=StatName,Stationsname in XAB.ini eintragen,16,144,193,%StatName%
Edit=strStatName,232,144,193,strStatName
CheckBox=MapReg,INI-Mapping ausführen*,16,328,193,%MapReg%
CheckBox=DefReg,Defaultwerte in Registry eintragen**,232,328,193,%DefReg%
Edit=ImgPath,312,32,113,ImgPath
Edit=AccSrc,232,224,193,AccSrc
CheckBox=CheckAccSrc,ODBC Source für Access erstellen*,16,224,193,%CheckAccSrc%
Edit=SQLSrc,232,248,73,SQLSrc
CheckBox=CheckSQLSrc,ODBC Src für SQL-Server erstellen*,16,248,193,%CheckSQLSrc%
CheckBox=PlugInReg,Geräte PlugIns registrieren - Nur wenn SIDEXIS nicht über Setup installiert wurde,16,168,409,%PlugInReg%
CheckBox=EnterStation,DB-Stationseintrag**,16,296,121,%EnterStation%
CheckBox=CheckAccStation,MS-Access,232,296,89,%CheckAccStation%
CheckBox=CheckSQLStation,SQL-Server,336,296,89,%CheckSQLStation%
Edit=strStatODBC,96,32,113,strStatODBC
Edit=strSrvName,376,248,49,strSrvName
Edit=strUser,96,272,113,strUser
Edit=strPass,320,272,105,strPass
CheckBox=TSE,TSE,168,296,41,%TSE%
Label=SQL-User:,16,272
Label=____________________________________________________________________,16,48
Label=____________________________________________________________________,16,304
Label=SQL-Server:,312,248
Label=SQL-User Pass:,232,272
Label=Datenbankzugriff konfigurieren,16,200
Label=SIDEXIS konfigurieren,16,72
EndDialog>MapTest


IfFileExists>%CWD%\MapCon.ini,IniConfig,DefaultConfig


Label>IniConfig
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_AppPath,AppPath
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_DBPath,DBPath
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_ImgPath,ImgPath
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_SIDserNr,SIDserNr
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_SIDNr,SIDNr
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_Praxis,Praxis
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_PraxName,PraxName
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_StatName,StatName
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_strStatName,strStatName
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_CheckAccSrc,CheckAccSrc
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_CheckSQLSrc,CheckSQLSrc
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_AccSrc,AccSrc
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_SQLSrc,SQLSrc
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_EnterStation,EnterStation
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_TSE,TSE
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_CheckAccStation,CheckAccStation
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_CheckSQLStation,CheckSQLStation
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_strSrvName,strSrvName
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_strStatODBC,strStatODBC
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_strUser,strUser
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_strPass,strPass
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_PlugInReg,PlugInReg
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_MapReg,MapReg
ReadIniFile>%CWD%\MapCon.ini,CONFIG,Dlg1_DefReg,DefReg
Let>MapConPath=%CWD%
Let>DefConPath=%CWD%
ConCat>MapConPath,\SIDEXIS_Map.reg
ConCat>DefConPath,\SIDEXIS_Default.reg
Goto>DelMapCon


Label>DefaultConfig
Let>AppPath=C:\SIDEXIS
Let>DBPath=D:\PDATA
Let>ImgPath=D:\PDATA
Let>SIDserNr=False
Let>SIDNr=*********
Let>Praxis=False
Let>PraxName=???
Let>StatName=False
Let>strStatName=Station Name
Let>CheckAccSrc=False
Let>CheckSQLSrc=True
Let>AccSrc=PDATA
Let>SQLSrc=PDATASQL
Let>EnterStation=True
Let>TSE=False
Let>CheckAccStation=False
Let>CheckSQLStation=True
Let>strSrvName=(local)
Let>strStatODBC=DSN immer eingeben!
Let>strUser=SXUser
Let>strPass=sirona
Let>PlugInReg=False
Let>MapReg=False
Let>DefReg=False
Let>MapConPath=%CWD%
Let>DefConPath=%CWD%
ConCat>MapConPath,\SIDEXIS_Map.reg
ConCat>DefConPath,\SIDEXIS_Default.reg


Label>DelMapCon
DeleteFile>%MapConPath%


Label>DelDefCon
DeleteFile>%DefConPath%


Label>MainLoop
Show>MapTest,result
If>result=1,Init
If>result=2,Abbruch
Goto>MainLoop


Label>Init
Let>AppPath=MapTest.AppPath
Let>DBPath=MapTest.DBPath
Let>ImgPath=MapTest.ImgPath
Let>SIDserNr=MapTest.SIDserNr
Let>SIDNr=MapTest.SIDNr
Let>Praxis=MapTest.Praxis
Let>PraxName=MapTest.PraxName
Let>StatName=MapTest.StatName
Let>strStatName=MapTest.strStatName
Let>CheckAccSrc=MapTest.CheckAccSrc
Let>CheckSQLSrc=MapTest.CheckSQLSrc
Let>AccSrc=MapTest.AccSrc
Let>SQLSrc=MapTest.SQLSrc
Let>EnterStation=MapTest.EnterStation
Let>TSE=MapTest.TSE
Let>CheckAccStation=MapTest.CheckAccStation
Let>CheckSQLStation=MapTest.CheckSQLStation
Let>strSrvName=MapTest.strSrvName
Let>strStatODBC=MapTest.strStatODBC
Let>strUser=MapTest.strUser
Let>strPass=MapTest.strPass
Let>PlugInReg=MapTest.PlugInReg
Let>MapReg=MapTest.MapReg
Let>DefReg=MapTest.DefReg
Goto>Init1


Label>Init1
......




Is this behavior known by anyone?

thx
migro
regards
migro

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Oct 12, 2005 4:29 pm

Migro,

The script is looking for the INI file in the %CWD% (current working directory). I never use "CWD" it's too easy to lose. I would recommend that you fully path the location of your INI file and hopefully that will take care of the problem.

Whenever I use any files in scripts I like to list them at the top of the script. Something like this:

Let>file1=c:\my path\my doc\myfile.ini
Let>file2=c:\my path\my doc\tempfile.tmp

Then I use the variables when I call the file:

ReadIniFile>%file1%,Section,Value,var

Hope this is helpful,
Dick

User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Wed Oct 12, 2005 6:02 pm

Dear Dick,

thx, your right with using the %CWD% Variable.

But it have nothing to do with the Problems occuring with the new msched-versions. Even if the ini-file is not found, the default-values have to be mapped into the dialog.

Strings in editfields are still working but with values for checkboxes it dont work anymore. All Checkboxes in the dialog are unchecked even if some of the Variables are set to "True".

If You try it out with Versions <7.4 you will see that it works without Problems.

greatings
migro
regards
migro

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Oct 12, 2005 7:32 pm

I had forgotten about this but it sounds like your problem might be related to this post:

http://www.mjtnet.com/forum/viewtopic.p ... ight=#9191

Basically, you must move your variable definitions to a point in the macro that is ahead of where the dialog box is defined.

Shooting in the dark.
Hope this helps,
Dick

User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Wed Oct 12, 2005 8:29 pm

thx for the answer but this new behavior shurely is a bug.

To move the variable definitions in front of the dialog-definitions wont solve the Problem. In this case the whole dialog isn't working anymore because other dialogelements won't show up.

Even in all manuals the dialog need to be defined first an then all other variables.

We made many solutions for our clients using Macroscheduler and with the new Versions I can not administer them. So I hope the guys from mjnet get this bug fixed quick.

migro
regards
migro

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts