Page 1 of 2 12>
Topic Options
#212136 - 2016-12-14 10:23 AM can some one help me
Powerdrib Offline
Fresh Scripter

Registered: 2016-12-14
Posts: 26
Loc: Holland
$InfoFrame = $Form.Frame ("Informatie", 250,5,240,120)
i get the error "Expected ')'" but i cant find where I must place it
if someone is kind enough to help that would be great

Top
#212137 - 2016-12-14 10:56 AM Re: can some one help me [Re: Powerdrib]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1832
Loc: Hilversum, The Netherlands
It looks like somewhere in the script you've missed a " or a '.
Apart from that try to remove the space before the "(".
 Code:
$InfoFrame = $Form.Frame("Informatie", 250,5,240,120)


Top
#212138 - 2016-12-14 11:01 AM Re: can some one help me [Re: Arend_]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1832
Loc: Hilversum, The Netherlands
If you're using KiXforms.net, I'm sure "Frame" is not a member of the Form object.
Top
#212140 - 2016-12-14 11:25 AM Re: can some one help me [Re: Arend_]
Powerdrib Offline
Fresh Scripter

Registered: 2016-12-14
Posts: 26
Loc: Holland
 Originally Posted By: Arend_
If you're using KiXforms.net, I'm sure "Frame" is not a member of the Form object.


I used your code but I get still the same error
I'm using Kixstarter as my editor

Top
#212141 - 2016-12-14 11:43 AM Re: can some one help me [Re: Powerdrib]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1832
Loc: Hilversum, The Netherlands
I used your code but I get still the same error
I'm using Kixstarter as my editor [/quote]

Could you paste your entire code here?
And please use code tags.

Top
#212142 - 2016-12-14 11:45 AM Re: can some one help me [Re: Powerdrib]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4615
Loc: The Netherlands
Is the code in your original post all there is? If not, can you post the full script so we can help to find the error. It looks like the issue is caused by another line in the script.

Edit: Hmmm....thatís what you get for starting a phone call when typing a reply. Arend beat me to it.


Edited by Mart (2016-12-14 11:46 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#212143 - 2016-12-14 11:55 AM Re: can some one help me [Re: Mart]
Powerdrib Offline
Fresh Scripter

Registered: 2016-12-14
Posts: 26
Loc: Holland
 Code:
;**************************************************************
;** Script:	Login Script
;** Version:	1.0
;** 
;** Author:	Mathieu van der Heijden
;** E-mail:	xxxxxxxxxxxxx@hotmail.com
;**
;**************************************************************

;Break Off
Break On

;Default Settings
$os=""
$os_type=""
$os_service_pack=""
$progressstep=3
$sleeptime=0
$numerrors=0
Global $time

Global $UpdateSoftware[0]
$userid=@userid
$Updates=0
$RunUpdates=$False
$tmpdir=ExpandEnvironmentVars("%tmp%")
$systemdrive=ExpandEnvironmentVars("%systemdrive%")
$windir=ExpandEnvironmentVars("%windir%")
$comspec=ExpandEnvironmentVars("%comspec%")
$Filelocation=ExpandEnvironmentVars("\\dc1\netlogon")

Global $DebugMessages[0]
$NumMessages=0
$DebugMessages[$NumMessages]="-BEGIN--------------------------"

;Main Application

; Draw Form
	DrawForms()

; Show News
	ShowNews()
	
; Connecting Drives
	ConnectDrives()

; Set machine to standard Settings
	StandardSettings()

; Create Temp Folders and Files
	Tempfolders()

; Fill Progressbar
While $ProgressBar.Value < 100
	Progress("Afronden",20)
Loop

Exit 1

;***********************************************************************
;**
;**  Update the clock
;**
Function UpdateClock()
	If @Time<>$time
		$Clock.Text=@Time
		$time=@time
	EndIf
EndFunction

;***********************************************************************
;**
;**  Retrieve News File
;**
Function ShowNews()
	$NewsRadioButton.Value=1
	Progress( "Retrieving News")
	If Open(1, $FileLocation + "\News.txt") = 0
		$NewsLine = ReadLine(1)
		While @ERROR=0
			$NewsTextBox.Text=$NewsTextBox.Text + $NewsLine + Chr(13) + Chr(10)
			$NewsLine = ReadLine(1)
		Loop
		If Close (1) <> 0
			DbgMessage("Error","News File could not be closed", @SError)
		EndIf
	Else
		DbgMessage("Debug","No News")
	EndIf
	$NewsRadioButton.Value=0
	$NewsRadioButton.Enabled =0
EndFunction

;***********************************************************************
;**
;**  Connect Shares to Drives
;**
Function ConnectDrives()
	$SharesRadioButton.Value=1
	Progress( "Connecting Drives")
	DbgMessage("Info","Connecting Drives:")
	Groepbepaling()
	ConnectHomeDrive()
	ConnectDefaultDrives()
	$SharesRadioButton.Value=0
	$SharesRadioButton.Enabled =0	
EndFunction

;***********************************************************************
;**
;**  Connect Home Drive
;**
Function ConnectHomeDrive()
	;******************************	
	; Home DriveShares
	;******************************	
	Progress( "Connecting H:")
	DbgMessage("Info","  - Y: = " + "\\dc1\users\$userid")
	
	Use H: /delete
	If ($NT_mode = "no") 
		DelKey("HKEY_CURRENT_USER\Network\Persistent\Y")
	EndIf
	Use H: "\\dc1\users\$userid"
		If @ERROR = 0
			DbgMessage ("Info","Home Share Connected")
		Else
			DBGMessage ("HOMESHR","No Home Share available")
			Return
		EndIf
EndFunction

;***********************************************************************
;**
;**  Connect DefaultShares to Drives
;**
Function ConnectDefaultDrives()
	;******************************	
	; Default DriveShares
	;******************************
	If Exist($FileLocation + "\shares.ini")
		For $x = 1 to 10 
			$DriveDefinition = ReadProfileString($FileLocation + "\shares.ini", "EVERYONE", "drive" + $x)
			If @ERROR = 0
				If $DriveDefinition<>""
			  		ConnectShare($DriveDefinition)
				EndIf
			Else
				Return
			EndIf
		Next
	EndIf
EndFunction

;***********************************************************************
;**
;**  Zorgen dat je een bepaalde groupshare krijgt door groeplidmaatschap
;**  
Function Groepbepaling()
	if ingroup ("Directie") $Group="Directie" ConnectGroupDrives() endif
	if ingroup ("Networking") $Group="Networking" ConnectGroupDrives() endif
Endfunction


;***********************************************************************
;**
;**  Connect GroupShares to Drives
;**
Function ConnectGroupDrives()
	;******************************	
	; GroupShares
	;******************************
	If Exist($FileLocation + "\shares.ini")
	DBGMessage ("Testing Groupshares",$group)
		If $group<>""
			For $x = 1 to 10 
				$DriveDefinition = ReadProfileString($FileLocation + "\shares.ini", $group, "drive" + $x)
				If @ERROR = 0
					If $DriveDefinition<>""
						ConnectShare($DriveDefinition)
					EndIf
				Else
					Return
				EndIf
			Next 
		EndIf
	EndIf
EndFunction

;************************************************************************
;**
;** Set machine to default settings
;**
Function StandardSettings()
	$StandardSettingsRadioButton.Value=1
	Progress( "Setting Standard Settings")
	DbgMessage("Info","Setting standard settings:")	
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iCountry" , "31" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iCurrency" , "2" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iDate" , "1" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iFirstDayOfWeek" , "0" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iFirstWeekOfYear" , "2" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iMeasure" , "0" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iNegCurr" , "11" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "iTime" , "1" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "Local" , "413" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "s1159" , "" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "s2359" , "" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sCountry" , "Netherlands" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sCurrency" , "Ä" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sDate" , "-" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sDecimal" , "," , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sLanguage" , "NLD" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sList" , ";" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sMonDecimalSep" , "," , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sMonThousandSep" , "." , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sShortDate" , "dd-MM-yyyy" , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sThousand" , "." , "REG_SZ")
		writevalue("HKEY_CURRENT_USER\Control Panel\International" , "sTimeFormat" , "H:mm:ss" , "REG_SZ")
		writevalue( "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" , "TaskbarSizeMove" , "0" , "REG_DWORD" )
		writevalue( "HKEY_CURRENT_USER\Control Panel\Colors" , "Background" , "50 240 0" , "REG_SZ")
		writevalue( "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects", "VisualFXSetting" , "2" , "REG_DWORD" )

		;****** Default Printer 
		$defprint = ReadValue("HKEY_CURRENT_USER\Software\Lantack", "defaultprinter")
		WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows", "device", "$defprint", "REG_SZ")

	$StandardSettingsRadioButton.Value=0
	$StandardSettingsRadioButton.Enabled=0
EndFunction

;************************************************************************
;**
;** Tijdelijke mappen aanmaken 
;**
Function Tempfolders()
	$TempfoldersRadioButton.Value=1
	Progress( "Tijdelijke mappen worden aangemaakt")
	DbgMessage("Info", "Tijdelijke mappen aanmaken")

	$TempfoldersRadioButton.Value=0
	$TempfoldersRadioButton.Enabled=0
EndFunction

;************************************************************
;** Function: ConnectShare 
;** Usage: ConnectShare ("H:, \\OXYGEN\LOG_Procurement$, Logistics Procurement")
;**
Function ConnectShare( $DriveDefinition)
	$DriveLetter=SubStr($DriveDefinition,1,InStr($DriveDefinition,",")-1)
	$DriveDefinition=Ltrim(Rtrim(SubStr($DriveDefinition,InStr($DriveDefinition,",")+1)))
	$Share=Ltrim(Rtrim(SubStr($DriveDefinition,1,InStr($DriveDefinition,",")-1)))
	$ShareDesc=Ltrim(Rtrim(SubStr($DriveDefinition,InStr($DriveDefinition,",")+1)))
	DbgMessage("Info","  - Disconnecting " + $DriveLetter + " on " + $Share)
;	Use $DriveLetter /delete
;	If @ERROR <> 0
;		DBGMessage ( "DisMountError", $DriveLetter)
;	EndIf
	If ($NT_mode = "no") 
		DelKey("HKEY_CURRENT_USER\Network\Persistent\" + $DriveLetter)
	EndIf
	Progress( "Connecting " + $DriveLetter + " to " + $Share)
	DbgMessage("Info","  - Connecting " + $DriveLetter + " on " + $Share)
	Use $DriveLetter $Share
	If @ERROR <> 0
		DBGMessage ( "MountError", $DriveLetter + " on " + $Share )
	EndIf
EndFunction 

;***********************************************************************
;**
;**  Update Progress Bar
;**
Function Progress($ProgressText,optional $Step)
	If $Step=""
		$Step=$progressstep
	EndIf
	$ProgressTextBox.Text=$ProgressText
	If $ProgressBar.Value + $Step < 101
		$ProgressBar.Value=$ProgressBar.Value+$Step
		If $DebugFlag = $TRUE		 
			Sleep $sleeptime
		EndIf
	Else
		$ProgressBar.Value=100
	EndIf
	$=Execute($Form.DoEvents())
EndFunction

;************************************************************
;** Function: DBGMessage
;** Usage: DBGMessage( "Debug", "DuhhBugg" ) 
;** DebugType : Info, Debug, Error
;**
Function DBGMessage($DebugType, $DebugMessage, Optional $SError)
	Select
		Case $DebugLevel="Error"
			If $DebugType="Info" OR $DebugType="Debug"
				Return
			EndIf
		Case $DebugLevel="Info"
			If $DebugType="Debug"
				Return
			EndIf
	EndSelect
	
	If $DebugType="Error"
		$numerrors=$numerrors+1
	EndIf
	$NumMessages=$NumMessages + 1
	ReDim Preserve $DebugMessages[$NumMessages]
	
	$DebugTime="" + @Date + " - " + @Time +" >"
	$DebugText=$DebugType + " : " + $DebugMessage
	If $SError<>""
		 $DebugText=$DebugText + " | Additional Info: @SERROR"
	EndIf
	
	$DebugMessages[$NumMessages]=$DebugTime + $DebugText
	If $DebugFlag = $TRUE		 
		$DbgTextBox.Text=$DbgTextBox.Text + $DebugText + @CRLF
		Sleep $sleeptime
	EndIf		
EndFunction

;***********************************************************************
;**
;**  DrawForms()
;**
Function DrawForms()

; Form
	$Form = CreateObject("Kixtart.Form")
	$Form.Caption = "PoliForm Login Script"
	$Form.Width = 500
	$Form.Height = 500
	If $DebugFlag=$True
		$Form.Left=(1280 / 2) - (500 / 2)
		$Form.Top=(1024  / 2) - (400 /2 )	
	Else
		$Form.Center
	EndIf
	; ClockTimer
		$Timer = $Form.Timer("600,0,0,15,15")
		$Timer.OnTimer = "UpdateClock()"

; Logo
	$Logo=$Form.PictureBox
	$Logo.Left=5
	$Logo.Top=5
	$Logo.Width=203
	$Logo.Height=239
	$Logo.Picture="reddev10.bmp"

; Info Frame 
	$InfoFrame = $Form.Frame("Informatie", 250,5,240,120)
		
	$UserIdLbl = $InfoFrame.Label("Username", 5, 15, 115, 15)
	$UserIdBox = $InfoFrame.TextBox(@USERID	, 120, 15, 115, 15)
	$UserIdBox.BackColor=$Form.BackColor
	$UserIdBox.Enabled=0
	$FullNameLbl = $InfoFrame.Label("Full Name", 5, 30, 115, 15)
	$FullNameBox = $InfoFrame.TextBox(@FULLNAME, 120, 30, 115, 15)
	$FullNameBox.BackColor=$Form.BackColor
	$FullNameBox.Enabled=0
	$WorkStnLbl = $InfoFrame.Label("Terminal Server", 5, 45, 115, 15)
	$WorkStnBox = $InfoFrame.TextBox(@WKSTA, 120, 45, 115, 15)
	$WorkStnBox.BackColor=$Form.BackColor
	$WorkStnBox.Enabled=0
	$DomainLbl = $InfoFrame.Label("Domein", 5, 60, 115, 15)
	$DomainBox = $InfoFrame.TextBox(@DOMAIN, 120, 60, 115, 15)
	$DomainBox.BackColor=$Form.BackColor
	$DomainBox.Enabled=0
	$TimeLbl = $InfoFrame.Label("Tijd", 5, 75, 115, 15)
	$TimeBox = $InfoFrame.TextBox(@TIME, 120, 75, 115, 15)
	$TimeBox.BackColor=$Form.BackColor
	$TimeBox.Enabled=0
	$DateLbl = $InfoFrame.Label("Datum", 5, 90, 115, 15)
	$DateBox = $InfoFrame.TextBox(@DATE, 120, 90, 115, 15)
	$DateBox.BackColor=$Form.BackColor
	$DateBox.Enabled=0

; Action Frame
	$ActionFrame = $Form.Frame("Bewerkingen",250,125,240,120)
	
	$NewsRadioButton = $ActionFrame.RadioButton("Bericht weergeven", 5, 15, 230, 15)
	$SharesRadioButton = $ActionFrame.RadioButton("Netwerkverbindingen maken", 5, 30, 230, 15)
	$StandardSettingsRadioButton = $ActionFrame.RadioButton("Standaard instellingen", 5, 45, 230, 15)			
	$TempfoldersRadioButton = $ActionFrame.RadioButton("Tijdelijke mappen aanmaken", 5, 60, 230, 15)

; Logging Frame
	$NewsFrame = $Form.Frame("Nieuws",5,250,485,150)
	
	$NewsTextBox = $NewsFrame.TextBox(",5,15,475,130")
	$NewsTextBox.BackColor = $Form.BackColor
	$NewsTextBox.MultiLine=1
	$NewsTextBox.Enable=0
	$NewsTextBox.Text=""
	$NewsTextBox.ScrollBars=2
	$NewsTextBox.Wordwrap=1

; Progress Bar
	$ProgressTextBox= $Form.TextBox
	$ProgressTextBox.Left=5
	$ProgressTextBox.Top=400
	$ProgressTextBox.Width=200
	$ProgressTextBox.Height=20
	$ProgressTextBox.Enable=0
	$ProgressTextBox.BackColor = $Form.BackColor	
	
	$ProgressBar = $Form.ProgressBar
	$ProgressBar.Left=210
	$ProgressBar.Top=400
	$ProgressBar.Width=220
	$ProgressBar.Height=20
	$ProgressBar.Style = 1

; Clock
	$CurrentTime=@Time
	$Clock = $Form.TextBox("",435,400,55,20)
	$Clock.Alignment=2
	$Clock.Enabled=0
	$Clock.BackColor=$Form.BackColor

$Form.Show
; DebugForm
If $DebugFlag=$True
	$DbgForm = CreateObject("Kixtart.Form")	
	$DbgForm.Caption = "DebugBox"
	$DbgForm.Width = 300
	$DbgForm.Height = 300
	$DbgForm.Left=1280 - 300
	$DbgFOrm.Top=1024 - 300
	
	$DbgTextBox=$DbgForm.TextBox()
	$DbgTextBox.Left=5
	$DbgTextBox.Top=5
	$DbgTextBox.Width=235
	$DbgTextBox.Height=205
	$DbgTextBox.MultiLine=1
	$DbgTextBox.Enable=0
	$DbgTextBox.Text=""
	$DbgTextBox.ScrollBars=2
	$DbgTextBox.Wordwrap=1	
	
	$CurrentX=0
	$CurrentY=0
;	$DbgForm.Show
;*********************************************************************************
;*************************************************
;**********************
;Om het debugwindow weer te geven moet de ";" voor $DbgForm.Show weggehaald worden
;**********************
;*************************************************
;*********************************************************************************

EndIf	

EndFunction


here is the full code


Edited by Arend_ (2016-12-14 01:13 PM)
Edit Reason: Removed email addres from code.

Top
#212144 - 2016-12-14 12:52 PM Re: can some one help me [Re: Powerdrib]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1832
Loc: Hilversum, The Netherlands
I can see that it's using the regular KiXforms, not KiXforms.Net.
However in the helpfile I have "Frame" is also not listed as a member of the Form class.
The code itself seems sound, I can't detect a missing bracket or quotation mark.

So to me it seems the error is related to the "Frame" member that does not exist when you call it with $Form.Frame.
Maybe someone else can shed more light on this.

Update, I've tested the simple code:
 Code:
$Form = CreateObject("Kixtart.Form")
? @SERROR
$InfoFrame = $Form.Frame("Informatie", 250,5,240,120)
? @SERROR

This seems to work fine so that indicated that the "Frame" part does indeed work.
I'll need more time to sift through the entire code.


Edited by Arend_ (2016-12-14 12:55 PM)
Edit Reason: Updated post

Top
#212145 - 2016-12-14 01:02 PM Re: can some one help me [Re: Arend_]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1832
Loc: Hilversum, The Netherlands
Try to reregister your kixforms.dll:
 Code:
regsvr32 -u kixforms.dll
regsvr32 kixforms.dll

Top
#212146 - 2016-12-14 01:10 PM Re: can some one help me [Re: Arend_]
Powerdrib Offline
Fresh Scripter

Registered: 2016-12-14
Posts: 26
Loc: Holland
 Originally Posted By: Arend_
Try to reregister your kixforms.dll:
 Code:
regsvr32 -u kixforms.dll
regsvr32 kixforms.dll
and how do i do that i'm a noob with kixtart

Top
#212147 - 2016-12-14 01:11 PM Re: can some one help me [Re: Powerdrib]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1832
Loc: Hilversum, The Netherlands
 Originally Posted By: Powerdrib
and how do i do that i'm a noob with kixtart

From Command Prompt, you type that in the black box :P

Top
#212148 - 2016-12-14 01:17 PM Re: can some one help me [Re: Arend_]
Powerdrib Offline
Fresh Scripter

Registered: 2016-12-14
Posts: 26
Loc: Holland
 Originally Posted By: Arend_
 Originally Posted By: Powerdrib
and how do i do that i'm a noob with kixtart

From Command Prompt, you type that in the black box :P
i have tried that and it didnt work still the same error "expected ')'"


Edited by Powerdrib (2016-12-14 01:37 PM)

Top
#212149 - 2016-12-14 03:29 PM Re: can some one help me [Re: Powerdrib]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2061
Loc: Tulsa, OK
This may or may not be an issue, but it doesnt look right to me...
 Code:
$Timer = $Form.Timer("600,0,0,15,15")
$Timer.OnTimer = "UpdateClock()"
maybe should be
 Code:
$Timer = $Form.Timer()
$Timer.Interval = 600 ; number of milliseconds
$Timer.OnTick = "UpdateClock()"

Top
#212150 - 2016-12-14 03:36 PM Re: can some one help me [Re: ShaneEP]
Powerdrib Offline
Fresh Scripter

Registered: 2016-12-14
Posts: 26
Loc: Holland
 Originally Posted By: ShaneEP
This may or may not be an issue, but it doesnt look right to me...
 Code:
$Timer = $Form.Timer("600,0,0,15,15")
$Timer.OnTimer = "UpdateClock()"
maybe should be
 Code:
$Timer = $Form.Timer()
$Timer.Interval = 600 ; number of milliseconds
$Timer.OnTick = "UpdateClock()"
thanks shane I changed it and it still worked

Top
#212151 - 2016-12-14 03:38 PM Re: can some one help me [Re: Powerdrib]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2061
Loc: Tulsa, OK
Like Arend said...That error usually lead to syntax error. Maybe start commenting out large chunks of the script until it works to narrow it down.

Sorry I would help more, but I don't have the kixforms dll registered on my work computer.

Top
#212152 - 2016-12-14 03:43 PM can some one help me [Re: ShaneEP]
Powerdrib Offline
Fresh Scripter

Registered: 2016-12-14
Posts: 26
Loc: Holland
 Code:
$InfoFrame = $Form.Frame("Informatie", 250,5,240,120)
		
	$UserIdLbl = $InfoFrame.Label("Username", 5, 15, 115, 15)
	$UserIdBox = $InfoFrame.TextBox(@USERID	, 120, 15, 115, 15)
	$UserIdBox.BackColor=$Form.BackColor
	$UserIdBox.Enabled=0
	$FullNameLbl = $InfoFrame.Label("Full Name", 5, 30, 115, 15)
	$FullNameBox = $InfoFrame.TextBox(@FULLNAME, 120, 30, 115, 15)
	$FullNameBox.BackColor=$Form.BackColor
	$FullNameBox.Enabled=0
	$WorkStnLbl = $InfoFrame.Label("Terminal Server", 5, 45, 115, 15)
	$WorkStnBox = $InfoFrame.TextBox(@WKSTA, 120, 45, 115, 15)
	$WorkStnBox.BackColor=$Form.BackColor
	$WorkStnBox.Enabled=0
	$DomainLbl = $InfoFrame.Label("Domein", 5, 60, 115, 15)
	$DomainBox = $InfoFrame.TextBox(@DOMAIN, 120, 60, 115, 15)
	$DomainBox.BackColor=$Form.BackColor
	$DomainBox.Enabled=0
	$TimeLbl = $InfoFrame.Label("Tijd", 5, 75, 115, 15)
	$TimeBox = $InfoFrame.TextBox(@TIME, 120, 75, 115, 15)
	$TimeBox.BackColor=$Form.BackColor
	$TimeBox.Enabled=0
	$DateLbl = $InfoFrame.Label("Datum", 5, 90, 115, 15)
	$DateBox = $InfoFrame.TextBox(@DATE, 120, 90, 115, 15)
	$DateBox.BackColor=$Form.BackColor
	$DateBox.Enabled=0

; Action Frame
	$ActionFrame = $Form.Frame("Bewerkingen",250,125,240,120)
	
	$NewsRadioButton = $ActionFrame.RadioButton("Bericht weergeven", 5, 15, 230, 15)
	$SharesRadioButton = $ActionFrame.RadioButton("Netwerkverbindingen maken", 5, 30, 230, 15)
	$StandardSettingsRadioButton = $ActionFrame.RadioButton("Standaard instellingen", 5, 45, 230, 15)			
	$TempfoldersRadioButton = $ActionFrame.RadioButton("Tijdelijke mappen aanmaken", 5, 60, 230, 15)

; Logging Frame
	$NewsFrame = $Form.Frame("Nieuws",5,250,485,150)
	
	$NewsTextBox = $NewsFrame.TextBox(",5,15,475,130")
in all these line the same error comes up so maybe its has something to do with the numbers at the end because if I remove the numbers from one line its says that the error is in the next line


Edited by Powerdrib (2016-12-14 03:53 PM)

Top
#212153 - 2016-12-14 05:12 PM Re: can some one help me [Re: Powerdrib]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4615
Loc: The Netherlands
Almost time to head home here but after dinner I'll copy and paste your code and do some checking.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#212154 - 2016-12-14 09:19 PM Re: can some one help me [Re: Mart]
ChristopheM Offline
Hey THIS is FUN
*****

Registered: 2002-05-13
Posts: 304
Loc: STRASBOURG, France
Hi,

i have made some changes in the code and put more parameters in the share config file.
i have rewriten the kixforms part. i hope this will be helpful.

if the config file is growing to much, it is a good thing to optimize by copying the file locally at the beginning iof the script. Reading a local ini file is more efficient because for each call to ReadProfileString, the file is entirely read from disk to memory.
For example, 10 reads in a file of 10 KB on a network share and it is 100 KB over the network !!!


Attachments
logon.zip (109 downloads)
Description:


_________________________
Christophe

Top
#212155 - 2016-12-14 09:27 PM Re: can some one help me [Re: Mart]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4615
Loc: The Netherlands
Not sure why but I have not been able to get a Frame working with your code. As far as I can see a frame is more or less the same as a multiline textbox (but I might be wrong as I never used frames).

This works fine for me.

 Code:
Break on

; Form
$Form = CreateObject("Kixtart.Form")
$Form.Caption = "Test"
$Form.Width = 500
$Form.Height = 500
$Form.Center

$TextBox = $Form.Controls.TextBox() 
$TextBox.Dock = Fill 
$TextBox.Multiline = "True" 
$TextBox.ScrollBars = Vertical 
$TextBox.Text = "" 
$TextBox.WordWrap = "True" 

$Form.show

AddText()

While $Form.Visible 
	$ = Execute($Form.DoEvents()) 
Loop 

Function AddText()
	$timer = 0
		
	For $timer = 0 to 20
		If $timer = 0
			$textBox.text = "Line: " + $timer
		Else
			$textBox.text = $TextBox.Text + @CRLF + "Line: " + $timer
		EndIf
		Sleep 1
	Next
EndFunction


It is also not that easy to test your script as it does things on my test system that I so not want. Just like Arend I do not see any missing or unmatched quotes or other weird things in your code.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#212156 - 2016-12-14 09:29 PM Re: can some one help me [Re: ChristopheM]
Glenn Barnas Moderator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4238
Loc: New Jersey
I ran the code through KGen to perform a Sanity check. Only warnings were from Undefined and Unused variables. Not best practice, but not technically an error either. The CSV data below represents the warning, varname, function and line where first referenced.
 Code:
Undeclared variable.,Implicit declaration as GLOBAL!,$os,Main,15
Undeclared variable.,Implicit declaration as GLOBAL!,$os_type,Main,16
Undeclared variable.,Implicit declaration as GLOBAL!,$os_service_pack,Main,17
Undeclared variable.,Implicit declaration as GLOBAL!,$progressstep,Main,18
Undeclared variable.,Implicit declaration as GLOBAL!,$sleeptime,Main,19
Undeclared variable.,Implicit declaration as GLOBAL!,$numerrors,Main,20
Undeclared variable.,Implicit declaration as GLOBAL!,$userid,Main,24
Undeclared variable.,Implicit declaration as GLOBAL!,$Updates,Main,25
Undeclared variable.,Implicit declaration as GLOBAL!,$RunUpdates,Main,26
Undeclared variable.,Implicit declaration as GLOBAL!,$False,Main,26
Undeclared variable.,Implicit declaration as GLOBAL!,$tmpdir,Main,27
Undeclared variable.,Implicit declaration as GLOBAL!,$systemdrive,Main,28
Undeclared variable.,Implicit declaration as GLOBAL!,$windir,Main,29
Undeclared variable.,Implicit declaration as GLOBAL!,$comspec,Main,30
Undeclared variable.,Implicit declaration as GLOBAL!,$Filelocation,Main,31
Undeclared variable.,Implicit declaration as GLOBAL!,$NumMessages,Main,34
Undeclared variable.,Implicit declaration as GLOBAL!,$ProgressBar,Main,55
Undeclared variable.,,$Clock,UpdateClock,67
Undeclared variable.,,$NewsRadioButton,ShowNews,77
Undeclared variable.,,$NewsLine,ShowNews,80
Undeclared variable.,,$NewsTextBox,ShowNews,82
Undeclared variable.,,$SharesRadioButton,ConnectDrives,100
Undeclared variable.,,$NT_mode,ConnectHomeDrive,122
Undeclared variable.,,$x,ConnectDefaultDrives,143
Undeclared variable.,,$DriveDefinition,ConnectDefaultDrives,144
Undeclared variable.,,$Group,Groepbepaling,161
Undeclared variable.,,$group,ConnectGroupDrives,175
Undeclared variable.,,$x,ConnectGroupDrives,177
Undeclared variable.,,$DriveDefinition,ConnectGroupDrives,178
Undeclared variable.,,$StandardSettingsRadioButton,StandardSettings,196
Undeclared variable.,,$defprint,StandardSettings,226
Undeclared variable.,,$TempfoldersRadioButton,Tempfolders,238
Undeclared variable.,,$DriveLetter,ConnectShare,251
Undeclared variable.,,$Share,ConnectShare,253
Undeclared variable.,,$ShareDesc,ConnectShare,254
Undeclared variable.,,$NT_mode,ConnectShare,260
Undeclared variable.,,$ProgressTextBox,Progress,279
Undeclared variable.,,$DebugFlag,Progress,282
Undeclared variable.,,$TRUE,Progress,282
Undeclared variable.,,$,Progress,288
Undeclared variable.,,$Form,Progress,288
Undeclared variable.,,$DebugLevel,DBGMessage,298
Undeclared variable.,,$DebugTime,DBGMessage,314
Undeclared variable.,,$DebugText,DBGMessage,315
Undeclared variable.,,$DebugFlag,DBGMessage,321
Undeclared variable.,,$TRUE,DBGMessage,321
Undeclared variable.,,$DbgTextBox,DBGMessage,322
Undeclared variable.,,$Form,DrawForms,334
Undeclared variable.,,$DebugFlag,DrawForms,338
Undeclared variable.,,$True,DrawForms,338
Undeclared variable.,,$Timer,DrawForms,345
Undeclared variable.,,$Logo,DrawForms,349
Undeclared variable.,,$InfoFrame,DrawForms,357
Undeclared variable.,,$UserIdLbl,DrawForms,359
Undeclared variable.,,$UserIdBox,DrawForms,360
Undeclared variable.,,$FullNameLbl,DrawForms,363
Undeclared variable.,,$FullNameBox,DrawForms,364
Undeclared variable.,,$WorkStnLbl,DrawForms,367
Undeclared variable.,,$WorkStnBox,DrawForms,368
Undeclared variable.,,$DomainLbl,DrawForms,371
Undeclared variable.,,$DomainBox,DrawForms,372
Undeclared variable.,,$TimeLbl,DrawForms,375
Undeclared variable.,,$TimeBox,DrawForms,376
Undeclared variable.,,$DateLbl,DrawForms,379
Undeclared variable.,,$DateBox,DrawForms,380
Undeclared variable.,,$ActionFrame,DrawForms,385
Undeclared variable.,,$NewsRadioButton,DrawForms,387
Undeclared variable.,,$SharesRadioButton,DrawForms,388
Undeclared variable.,,$StandardSettingsRadioButton,DrawForms,389
Undeclared variable.,,$TempfoldersRadioButton,DrawForms,390
Undeclared variable.,,$NewsFrame,DrawForms,393
Undeclared variable.,,$NewsTextBox,DrawForms,395
Undeclared variable.,,$ProgressTextBox,DrawForms,404
Undeclared variable.,,$CurrentTime,DrawForms,420
Undeclared variable.,,$Clock,DrawForms,421
Undeclared variable.,,$DbgForm,DrawForms,429
Undeclared variable.,,$DbgTextBox,DrawForms,436
Undeclared variable.,,$CurrentX,DrawForms,447
Undeclared variable.,,$CurrentY,DrawForms,448
Variable declared but not referenced.,Declaration line is referenced above.,$UpdateSoftware,Global,23
 80 warnings generated, 460 lines processed.,,,,
Glenn
_________________________

Actually I am a Rocket Scientist! \:D

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 146 anonymous users online.
Newest Members
nremmel, AlexTheGreat, ovdmtz, AlexPallaress, wschenk
17490 Registered Users

Generated in 0.046 seconds in which 0.012 seconds were spent on a total of 15 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org