Sign in to follow this  
Followers 0
Kiti

@MDAY not a number?

9 posts in this topic

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If you learn to debug properly you can figure these things out yourself :)

For example this simple line will probably solve the problem for you:

MsgBox(0,"Debug",@MDAY&@CRLF&VarGetType(@MDAY))

:P

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

If you learn to debug properly you can figure these things out yourself :)

For example this simple line will probably solve the problem for you:

MsgBox(0,"Debug",@MDAY&@CRLF&VarGetType(@MDAY))

:P

Where can I learn to debug properly? :mad: The only sources I use for learning are SciTe Help, and other posts on the forum. No debuging in eitherone.

Tnx for the help :P Now, how can I convert it to number? In the help, I saw only to binary and to hex...

I got used to logical things in AutoIt. So... If it is a VarGetType, why not a VarSetType? :D

Edited by Kiti

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Just use Int() on the macro before passing it to _ExcelWriteCell():

_ExcelWriteCell($oExcel, "Test", 1, Int(@MDAY))

Here's the functions I usually use when debugging:

_ArrayDisplay(); So f-ing useful!
ConsoleWrite(); Display debug data during the execution of the script
MsgBox(); Halt and displays data 
VarGetType(); Very important, as you could see before
StringLen(); Usefull to see if there are any hidden characters in a string that f's up the script (leading and trailing spaces etc.)
UBound(); To see how big your arrays are
@ScriptLineNumber; Macro so you can see which line the script is at
; And of course the debug UDF included in the standard installation, I never use it though, seems like overkill.

:)

Edit: Too late, but at least you got some debug info :P

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Thank you a lot, moncores! :)

Do you know how can I prevent a windows from beeing closed? I have an OnExitFunc, and I want to prevent the windows that function is working in to be closed before the script is. I didn't post another topic because I thought it's a minor question, and maybe you can answer it :P

Share this post


Link to post
Share on other sites

Thank you a lot, moncores! :)

Do you know how can I prevent a windows from beeing closed? I have an OnExitFunc, and I want to prevent the windows that function is working in to be closed before the script is. I didn't post another topic because I thought it's a minor question, and maybe you can answer it :P

Huh?

Use #NoTrayIcon if you don't want the user to exit your script through the tray icon.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Huh?

Use #NoTrayIcon if you don't want the user to exit your script through the tray icon.

Sorry, I didn't expressed myself clearly. This is what my script (I want to) do: Someone works in excel, and at the end of each day, some final data is moved around in that's day coresponding column. But if the user exits Excel first, the script can't do that task, because the file to which it is attached is closed. Also, this has to be the last thing done, so it has to be onExit. What I want to do is to restrict the order these two can be closed (Excel and my script). And, if my script don't let Excel to be closed, then the user will close first my script, and second, Excel, so the conditon of the closing order is met. But I don't know how to make Excel "uncloseable". :) I hope you understood.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0