AutoHotkey Community

It is currently May 26th, 2012, 11:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: October 30th, 2008, 11:26 pm 
I need some help getting this to work right. Im trying to write every other day for sixty days too a second window. I checked var1 and var2 and the dates are correct but it wont seem to display it.
any help is appreciated
Code:
FileReadLine,vStart,C:\AHK\Date.txt,1 ;Has specific date
EnvAdd, MyCount, 2
var1 = %Start%
var1 += 60, days

Loop, 30
{
Var2 = %Start%
Var2 += 2,days
}
Gui 2: Show,  x144 y306 h450 w343,Dates
Gui, Add,Text, %Var2% 'n ,Dates
Return


When I add Gui Submit it crashes my code?

Code:
Gui 2: Show,  x144 y306 h450 w343,Dates
Gui, Submit
Gui, Add,Text, %Var2% 'n ,Dates

Return[/code]
Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2008, 11:40 pm 
Code:
FileReadLine, Start, C:\AHK\Date.txt, 1 ;Has specific date
EnvAdd, MyCount, 2
var1 := Start
var1 += 60, days

Gui, Add, Text, vMyVar , %Var1%\%Var2%
Gui 2: Show,  x144 y306 h450 w343, Dates
Return

!y:: ; press ALT+y to start the loop
Loop, 30 {
   Var2 = Start
   Var2 += 2, Days
   GuiControl, , MyVar, %Var2%
   Sleep, 500
   }
   
Not tested. 8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 12:05 am 
Offline

Joined: August 20th, 2007, 6:57 pm
Posts: 185
Thanks for the quick reply bobo It's still not writing to second window. It seems like every things correct. hmm maybe a cheesy send to a text box:!:
:evil: Im probably just frustrated and over looking something simple back to the AHK manuals


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 2:54 am 
Offline

Joined: August 20th, 2007, 6:57 pm
Posts: 185
Ok problem solved with
Code:
Gui,2:Add,Text,,%Var2%

thanks

NEW Problem: it seems the date only reads two days after the date in variable %start%. so it works but I guess I need to add another variable to retrieve the previous date and add two to that? any Ideas Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 3:25 am 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
Code:
Gui, Submit, NoHide

=D

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 3:41 pm 
Offline

Joined: August 20th, 2007, 6:57 pm
Posts: 185
Why that does help with the formating it doesn't solve the new problem.

I can't seem to get it I need it to read
11/01/08
11/03/08
11/05/08
etc.

I can't figure this out any other Idea guys/girls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 3:57 pm 
Mkbailey755 wrote:
Why that does help with the formating it doesn't solve the new problem.

I can't seem to get it I need it to read
11/01/08
11/03/08
11/05/08
etc.

I can't figure this out any other Idea guys/girls


Code:
;FileReadLine, Start, C:\AHK\Date.txt, 1 ;Has specific date
start = 20081101 ; fake initialize - get real start from file

var2 = %Start% ; <-- add this line
!y:: ; press ALT+y to start the loop
Loop, 30 {
;     Var2 = Start ; <-- delete this line
   Var2 += 2, Days
;   GuiControl, , MyVar, %Var2%  ; uncomment for real code use
msgbox, ,, %var2%, 1  ; for demo only, I didn't create the gui
}
ExitApp


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 4:47 pm 
Offline

Joined: August 20th, 2007, 6:57 pm
Posts: 185
Solved
Code:
FileReadLine,vStart,C:\AHK\Date.txt,1 ;Has specific date
EnvAdd, MyCount, 2
var1 = %Start%
var1 += 60, days

Loop, 30
{
Mycount1 += 2 ;<= Put counter in
Var2 = %Start%
Var2 += %Mycount1%,days ;<=now date is added 2,4,6,8,10,etc.
}
Gui 2: Show,  x144 y306 h450 w343,Dates
Gui, Add,Text, %Var2% 'n ,Dates
Return

Thanks for all the help :D
output
Quote:
11/02/2008
11/04/2008
11/06/2008
11/08/2008
11/10/2008
11/12/2008
11/14/2008
11/16/2008
11/18/2008
11/20/2008
11/22/2008
11/24/2008
11/26/2008
11/28/2008
11/30/2008
12/02/2008
12/04/2008
12/06/2008
12/08/2008
12/10/2008
12/12/2008
12/14/2008
12/16/2008
12/18/2008
12/20/2008
12/22/2008
12/24/2008
12/26/2008
12/28/2008
12/30/2008
01/01/2009
01/03/2009
01/05/2009
01/07/2009
01/09/2009
01/11/2009
01/13/2009
01/15/2009
01/17/2009
01/19/2009
01/21/2009
01/23/2009


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 49 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group