KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Where to put my writeprofilestring command.

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
sbeverley
KiXforms Dabbler
KiXforms Dabbler


Joined: 18 Sep 2003
Posts: 11

PostPosted: Thu Sep 18, 2003 4:45 pm    Post subject: Where to put my writeprofilestring command. Reply with quote

I 'm trying to figure out where or how I can put a writeprofilestring in my kix form.
What I have is a nice form tht allows a users to either complete an update or wait untill the newxt time they are prompted.
I want to be able to log that the users has done the update adn write an entry to a log file and a file on tehir system that indicates to me they ran their update.

I have 2 buttons that have two different functions setup to them.
I have tried putting my writeprfilestring in my function but Iget an error that there is no endfunction for my function.

Any help would be great
Sad

_________________
Steve A Beverley
Back to top
View user's profile Send private message Visit poster's website
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Thu Sep 18, 2003 5:25 pm    Post subject: Reply with quote

How about putting the logging option at the exit point of the script? Confused

And check your scripts for correct syntax!

_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Thu Sep 18, 2003 5:27 pm    Post subject: Reply with quote

You may have to post some of your code before we can answer. Otherwise, we may just have to guess. Wink
Back to top
View user's profile Send private message MSN Messenger
sbeverley
KiXforms Dabbler
KiXforms Dabbler


Joined: 18 Sep 2003
Posts: 11

PostPosted: Thu Sep 18, 2003 6:10 pm    Post subject: My Code Reply with quote

Here is my code:

[
Code:
color=brown]Break On
;SETCONSOLE("Hide")
;********* FORM CREATE BEGIN **********
$Form = CreateObject('Kixtart.Form')
$Form.BackColor = 130,151,193
$Form.ControlBox = "True"
$Form.DrawGrid = "True"
$Form.FontBold = "False"
$Form.FontItalic = "False"
$Form.FontName = "Microsoft Sans Serif"
$Form.FontSize = 8.25
$Form.FontUnderline = "False"
$Form.ForeColor = 0,0,0
$Form.FormBorderStyle = 2
$Form.Height = 378
$Form.Icon = laptop.ico
$Form.Left = 234
$Form.MaximizeBox = "True"
$Form.MinimizeBox = "True"
$Form.SizeGripStyle = 0
$Form.StartPosition = Center
$Form.Tag = ""
$Form.Text = " Laptop Update"
$Form.Top = 166
$Form.ToolTipText = ""
$Form.TopMost = "False"
$Form.Width = 600
$Form.WindowState = 0
;********* FORM CREATE END **********

;************* BUTTON1 **************
$Button1 = $Form.Controls.Button
$Button1.Anchor = 5
$Button1.TextAlign = 32
$Button1.Enabled = "True"
$Button1.FlatStyle = 2
$Button1.FontBold = "False"
$Button1.FontItalic = "False"
$Button1.FontName = "Microsoft Sans Serif"
$Button1.FontSize = 8.25
$Button1.FontUnderline = "False"
$Button1.ForeColor = 0,0,0
$Button1.Height = 23
$Button1.Left = 195
$Button1.TabStop = "True"
$Button1.Tag = ""
$Button1.Text = "Update"
$Button1.ToolTipText = ""
$Button1.Top = 285
$Button1.Visible = "True"
$Button1.Width = 75
$Button1.OnClick = "Update()"
;*************************************

;************* BUTTON2 **************
$Button2 = $Form.Controls.Button
$Button2.Anchor = 5
$Button2.TextAlign = 32
$Button2.Enabled = "True"
$Button2.FlatStyle = 2
$Button2.FontBold = "False"
$Button2.FontItalic = "False"
$Button2.FontName = "Microsoft Sans Serif"
$Button2.FontSize = 8.25
$Button2.FontUnderline = "False"
$Button2.ForeColor = 0,0,0
$Button2.Height = 23
$Button2.Left = 330
$Button2.TabStop = "True"
$Button2.Tag = ""
$Button2.Text = "Cancel"
$Button2.ToolTipText = ""
$Button2.Top = 285
$Button2.Visible = "True"
$Button2.Width = 75
$Button2.OnClick = "Cancel()"
;*************************************


;************* BUTTON3 **************
$Button3 = $Form.Controls.Button
$Button3.Anchor = 5
$Button3.TextAlign = 32
$Button3.Enabled = "True"
$Button3.FlatStyle = 2
$Button3.FontBold = "False"
$Button3.FontItalic = "False"
$Button3.FontName = "Microsoft Sans Serif"
$Button3.FontSize = 8.25
$Button3.FontUnderline = "False"
$Button3.ForeColor = 0,0,0
$Button3.Height = 23
$Button3.Left = 260
$Button3.TabStop = "True"
$Button3.Tag = ""
$Button3.Text = "Finish"
$Button3.ToolTipText = ""
$Button3.Top = 285
$Button3.Visible = "False"
$Button3.Width = 75
$Button3.OnClick = "Finish()"
;*************************************

;************* PROGRESSBAR1 **************
$ProgressBar1 = $Form.Controls.ProgressBar
$ProgressBar1.Anchor = 5
$ProgressBar1.BackColor = 130,151,193
$ProgressBar1.Enabled = "True"
$ProgressBar1.ForeColor = 0,0,0
$ProgressBar1.Height = 10
$ProgressBar1.Left = 150
$ProgressBar1.Maximum = 100
$ProgressBar1.Minimum = 0
$ProgressBar1.Step = 10
$ProgressBar1.Tag = ""
$ProgressBar1.Top = 150
$ProgressBar1.Value = 0
$ProgressBar1.Visible = "False"
$ProgressBar1.Width = 300
;*************************************


;************* PROGRESSBAR2 **************
$ProgressBar2 = $Form.Controls.ProgressBar
$ProgressBar2.Anchor = 5
$ProgressBar2.BackColor = 130,151,193
$ProgressBar2.Enabled = "True"
$ProgressBar2.ForeColor = 0,0,0
$ProgressBar2.Height = 10
$ProgressBar2.Left = 150
$ProgressBar2.Maximum = 100
$ProgressBar2.Minimum = 0
$ProgressBar2.Step = 10
$ProgressBar2.Tag = ""
$ProgressBar2.Top = 100
$ProgressBar2.Value = 0
$ProgressBar2.Visible = "False"
$ProgressBar2.Width = 300
;*************************************

;************* LABEL1 **************
$Label1 = $Form.Controls.Label
$Label1.Anchor = 5
$Label1.BackColor = 89,114,182
$Label1.BorderStyle = 0
$Label1.Enabled = "True"
$Label1.FlatStyle = 2
$Label1.FontBold = "False"
$Label1.FontItalic = "False"
$Label1.FontName = "Microsoft Sans Serif"
$Label1.FontSize = 8.25
$Label1.FontUnderline = "False"
$Label1.ForeColor = 224,224,224
$Label1.Height = 100
$Label1.Left = 105
$Label1.Tag = ""
$Label1.Text = "   Your Laptop is in need of being updated. The update is very small and should only take a few moments depending on your connection speed. Once the update has completed , you will need to reboot your laptop. You may choose to update your laptop today or wait until you are ready to do so. The update will be forced on September 30th."
$Label1.ToolTipText = ""
$Label1.Top = 180
$Label1.Visible = "True"
$Label1.Width = 400
;*************************************

;************* LABEL2 **************
$Label2 = $Form.Controls.Label
$Label2.Anchor = 5
$Label2.BackColor = 89,114,182
$Label2.BorderStyle = 0
$Label2.Enabled = "True"
$Label2.FlatStyle = 2
$Label2.FontBold = "True"
$Label2.FontItalic = "False"
$Label2.FontName = "Microsoft Sans Serif"
$Label2.FontSize = 8.25
$Label2.FontUnderline = "False"
$Label2.ForeColor = 225,225,225
$Label2.Height = 15
$Label2.Left = 150
$Label2.Tag = ""
$Label2.Text = " "
$Label2.ToolTipText = ""
$Label2.Top = 200
$Label2.Visible = "False"
$Label2.Width = 300
;*************************************

;************* PICTUREBOX1 **************
$PictureBox1 = $Form.Controls.PictureBox
$PictureBox1.Anchor = 5
$PictureBox1.BackColor = 89,114,182
$PictureBox1.BorderStyle = 0
$PictureBox1.Enabled = "True"
$PictureBox1.Height = 350
$PictureBox1.Left = 0
$PictureBox1.Picture = "laptopupdate.bmp"
$PictureBox1.Tag = ""
$PictureBox1.Top = 0
$PictureBox1.Visible = "True"
$PictureBox1.Width = 600
;*************************************

$Form.Show
While $Form.Visible
  $=Execute($Form.DoEvents())
Loop
Exit 1



FUNCTION Update()
$ProgressBar1.Visible = "True"
$ProgressBar2.Visible = "True"
$Label1.Top = 200
$Label2.Top = 180
$Label2.Text = "         Downloading Updated files to your laptop"
$Label1.Text = "               This will take a few minutes depending on your connection speed"
$Label2.Visible = "True"
$Button1.Visible = "FALSE"
sleep 0.5
$ProgressBar1.Value = 10
SLEEP 0.5
$ProgressBar2.Value = 10

SLEEP 0.5
$ProgressBar1.Value = 20
SLEEP 0.5
$ProgressBar2.Value = 20

SLEEP 0.5
$ProgressBar1.Value = 40
SLEEP 0.5
$ProgressBar2.Value = 30

SLEEP 0.5
$ProgressBar1.Value = 60
SLEEP 0.5
$ProgressBar2.Value = 60

SLEEP 0.5
$ProgressBar1.Value = 80
SLEEP 0.5
$ProgressBar2.Value = 80

SLEEP 0.5
$ProgressBar1.Value = 100
SLEEP 0.5
$ProgressBar2.Value = 100
SLEEP 0.5
$ProgressBar1.Value = 0

$ProgressBar1.Visible = "FALSE"
$ProgressBar2.Visible = "FALSE"
$Label2.Left = 230
$Label2.FontSize = 10
$Label2.Fontbold = "True"
$Label2.Top = 150
$Label2.Text = "Update Complete"
$Label1.Visible = "True"
$Label1.Top = 180
$Label1.Text = "Your Laptop has been Sucessfully updated. In order to complete the update you will need to log of and reboot your laptop."
$Label1.FontSize = 8.25
$Label1.Fontbold = "True"
$Label2.ForeColor = 0,255,0
$Button2.Visible = "FALSE"
$Button3.Visible = "TRUE"
$Button3.FontBold = "TRUE"
$Completed = "Yes"
ENDFUNCTION



FUNCTION Cancel()
   Quit()
ENDFUNCTION

FUNCTION Finish()
"Update Complete"
ENDFUNCTION[/color]


I'd love to know how to set this up so that on say September 30th the update automatically runs. I also would love to have it log once the script is finished.
Let me know what you think.

_________________
Steve A Beverley
Back to top
View user's profile Send private message Visit poster's website
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Thu Sep 18, 2003 6:27 pm    Post subject: Reply with quote

As I said, put the logging into the exit code of the script, i.e. when the form is beign closed.

The progress bar update can be done with a FOR loop, neater code.

_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group