Page 13 of 18

Posted: Thu Jun 07, 2007 3:23 pm
by ts-soft
you can test this:

Code: Select all

dhGetValue("%T", @Result, ".Screen.Area(%d, %d, %d, %d, %m, %b)", 8, 8, 8, 22, 1)
i have sometimes the same error while a value is boolean and not long

Posted: Thu Jun 07, 2007 5:04 pm
by Kwai chang caine
i believe i have found the problem.

it misses the "Session"

Code: Select all

dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %b)", 8, 8, 8, 22, 1)

Posted: Thu Jun 07, 2007 5:10 pm
by Kwai chang caine
That's ok !!!!!!

The screen area run correctly now.

I love you :D

Posted: Thu Jun 07, 2007 5:24 pm
by Kwai chang caine
A last question please, and i disappear.
I promises you :D

The last function which I need :

Code: Select all

Do  
 Loop Until Session.Screen.OIA.Xstatus = 0

Posted: Thu Jun 07, 2007 5:31 pm
by ts-soft

Code: Select all

Define.l Result = 1
While Result
  dhGetValue("%d", @Result, Session,".Screen.OIA.Xstatus")
Wend
or a boolen %b
but i missing: what is to do?

Posted: Fri Jun 08, 2007 2:50 am
by mk-soft
Is the type unknown used type variant ("%v") for result and checked after GetValue then type of variant.

Code: Select all

dhGetValue("%v", @Result.variant, ...)
debug Result\vt
GT :wink:

Posted: Mon Jun 11, 2007 10:17 am
by Kwai chang caine
Hello i'm back :D

Excuse me for the long answer, i have another and hard job (no good) to do in 3 day :cry:

Thank you for your friendly help 8)

Code: Select all

Define.l Result = 1 
While Result 
  dhGetValue("%d", @Result, Session,".Screen.OIA.Xstatus") 
Wend
is the good code, but i want to copy it in a procedure and he don't work :cry:

Code: Select all

Procedure TestOIA()
 
 Define Resultat.l
 Resultat = 1 
       
 Repeat 
  dhGetValue("%d", @Resultat, Session,".Screen.OIA.Xstatus") 
 Until  Resultat = 0 

 Delay(500)

EndProcedure
Image

What is wrong ????

Posted: Mon Jun 11, 2007 10:45 am
by Kiffi
Kwaï chang caïne wrote:A last question please, and i disappear.
I promises you :D
Kwaï chang caïne wrote:Hello i'm back :D
:lol:
Kwaï chang caïne wrote:What is wrong ????
do you define the variable 'Session' global?

Alternatively you can pass the Session-Variable as a proc-parameter:

Code: Select all

Procedure TestOIA(Session.l) ...
Greetings ... Kiffi

Posted: Mon Jun 11, 2007 11:05 am
by Kwai chang caine
Hello kiffy

I'm glad to talk you, one more time :D

you are right, I am a little liar :lol:
I really believed that it the last, but i was mistaken.

I held my promise (Just for 3 day :lol: ).
it is that the love :lol:

Thanks for your answer for help me 8)

Yes i don't understand because the variable "Session" is global :shock:

Code: Select all

Procedure TestOIA()
 
 Define Resultat.l
 Resultat = 1 
       
 Repeat 
  dhGetValue("%d", @Resultat, Session,".Screen.OIA.Xstatus") 
 Until  Resultat = 0 

 Delay(500)

EndProcedure

RunProgram ("C:\Program Files\atra.exe") 
Delay(5000)

Global System.l
Global Session.l
Global Result.l 
dhToggleExceptions(#True) 

System = dhCreateObject("atra.System") 

If System 
  
  dhGetValue("%o", @Session, System, ".ActiveSession") 
  
  If Session 
    dhCallMethod(Session, ".Screen.SendKeys(%T)", @"Coucou") 
    TestOIA()
    dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %d)", 15, 37, 15, 71, 1)
    TestOIA()
    dhFreeString(Result)
    dhFreeString(Resultat)
    dhReleaseObject(Session) 
    
  Else 
    MessageRequester("", "Couldn't create Session-Object") 
  EndIf 
  
  dhReleaseObject(System) 
  
Else 
  MessageRequester("", "Couldn't create System-Object") 
EndIf

Posted: Mon Jun 11, 2007 2:46 pm
by Kwai chang caine
YOOOOOOOOUUUUUPPPPIIIIIII !!!!!!!

That's correct now
Session in global don't work :cry:
The variable session must be passed in parameter

Code: Select all

Procedure TestOIA(Session.l)
kiffi, You have always right 8)
I thank you once again, you are the best.

Thanks two at Ts-Soft for his extraordinary lib.
I had awaited that for two years

i'm not a beautiful girl, but i give you a french kiss for your nice help.
I wish you a good day.

With the pleasure of speaking again you (especially for me :lol: )

Posted: Mon Jun 11, 2007 2:54 pm
by ABBKlaus
:lol:
Global allows the variables to be used as global, ie: they can be accessed inside a Procedure. In this case the command Global for the according variables must be called before the declaration of the procedure. Each variable can have a default value directly assigned to it.
then this could work too :

Code: Select all

Global System.l 
Global Session.l 
Global Result.l 

Procedure TestOIA() 
  
 Define Resultat.l 
 Resultat = 1 
        
 Repeat 
  dhGetValue("%d", @Resultat, Session,".Screen.OIA.Xstatus") 
 Until  Resultat = 0 

 Delay(500) 

EndProcedure 

RunProgram ("C:\Program Files\atra.exe") 
Delay(5000) 

dhToggleExceptions(#True) 

System = dhCreateObject("atra.System") 

If System 
  
  dhGetValue("%o", @Session, System, ".ActiveSession") 
  
  If Session 
    dhCallMethod(Session, ".Screen.SendKeys(%T)", @"Coucou") 
    TestOIA() 
    dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %d)", 15, 37, 15, 71, 1) 
    TestOIA() 
    dhFreeString(Result) 
    dhFreeString(Resultat) 
    dhReleaseObject(Session) 
    
  Else 
    MessageRequester("", "Couldn't create Session-Object") 
  EndIf 
  
  dhReleaseObject(System) 
  
Else 
  MessageRequester("", "Couldn't create System-Object") 
EndIf 
Regards Klaus

Posted: Mon Jun 11, 2007 3:26 pm
by Dare
Kwaï chang caïne wrote:The happiness is a road, not a destination
Too true!


You appear to be using @session (address of) in the one case and just session (value of contents) in others.

Edit: Not saying this is the reason, just wondering.

Posted: Mon Jun 11, 2007 9:11 pm
by Kwai chang caine
Thanks at you two 8)

Posted: Mon Jun 11, 2007 9:41 pm
by ts-soft
Dare wrote:You appear to be using @session (address of) in the one case and just session (value of contents) in others.

Edit: Not saying this is the reason, just wondering.
For all results (strings, long, object ...) always a pointer (byref) required
Strings and objects have to be freed by you

Posted: Tue Jun 26, 2007 4:20 pm
by Xombie
I'm working on a small project for work and have a question. Is it possible to get information on a current Excel session?

For example, I have Excel already opened and two workbooks loaded. I would like to get the Excel.Application object for those workbooks.

I'm hoping that's using dhGetObject() but I can't seem to get that working.

Can it be done?

Thanks!