HyperNext Studio

HyperNext Studio => Interface Controls => Topic started by: sparkythex on December 21, 2010, 01:09:53 AM

Title: work around for card view switching
Post by: sparkythex on December 21, 2010, 01:09:53 AM
so i read in the guide that it says
 
Quote
GotoCard 2
   @ this line and following are not executed
   Put 10 into y
i really want to open a card & the pass that entered field back.

is there a good work around for that.
because it is really handy to call up window have text entered & then do something with this on the prior window.

can i call a card from a function of main card so that it will come back to my code?
example:
Code: [Select]
put 5 into x
call showcard2
put 10 into y


-------------
i really don't need a card to be displayed but
i think RB & VB call it an input dialog.
does hypernext have this (i only find message or choice as dialog; no input opt.)
Title: Re: work around for card view switching
Post by: Malkom on December 21, 2010, 11:07:59 AM
Quote from: "sparkythex"
so i read in the guide that it says
 
Quote
GotoCard 2
   @ this line and following are not executed
   Put 10 into y
i really want to open a card & the pass that entered field back.

is there a good work around for that.
because it is really handy to call up window have text entered & then do something with this on the prior window.

can i call a card from a function of main card so that it will come back to my code?
example:
Code: [Select]
put 5 into x
call showcard2
put 10 into y


-------------
i really don't need a card to be displayed but
i think RB & VB call it an input dialog.
does hypernext have this (i only find message or choice as dialog; no input opt.)
If you need to set the text in a field on another card then use the FieldCardSet command:

Code: [Select]
@ set text in a field 5 on card 3
FieldCardSet(3,5,'some data')


If you need to get some text from a field on another card then use the FieldCardFN function:

Code: [Select]
@ get text from field 7 on card 21
Put FieldCardFN(21,7) into x

Another method is to place your data in some global variables and when the other card opens it just reads those global variables and places their contents in the card fields or other controls.
Title: Re: work around for card view switching
Post by: sparkythex on December 21, 2010, 05:22:33 PM
you may already know this but i tried to call a card from a function & it still seeemed to stop the code.
Title: Re: work around for card view switching
Post by: Malkom on December 22, 2010, 11:53:50 AM
Quote from: "sparkythex"
you may already know this but i tried to call a card from a function & it still seeemed to stop the code.

Can you please explain? - once the GotoCard is called then the target card is loaded and the previous card goes out of focus and its local variables, procedures etc cannot be accessed until that card is loaded again.
Title: Re: work around for card view switching
Post by: sparkythex on December 23, 2010, 08:39:41 PM
Quote from: "Malkom"
Quote from: "sparkythex"
you may already know this but i tried to call a card from a function & it still seeemed to stop the code.

Can you please explain? - once the GotoCard is called then the target card is loaded and the previous card goes out of focus and its local variables, procedures etc cannot be accessed until that card is loaded again.

main card function "switchcard"
Code: [Select]
@main card function switchcard
gotocard 5
this is was i was referring to it still doesn't work this way either.
Code: [Select]
@button 1 script on card 1
call switchcard
@ this code still not ran just like as if i had done the "gotocard 5" command directly
put append FieldCardFN(2,6)  onto NoCont1Var

what i had to do was
Code: [Select]
@ on card 1
gotocard 5
then
Code: [Select]
@ on card 5
@ all the code about
put append FieldCardFN(2,6)  onto NoCont1Var
@then
 gotocard 1

I would have figured you would have tried something like that.
Title: Re: work around for card view switching
Post by: Malkom on December 24, 2010, 05:42:20 AM
Quote from: "sparkythex"
Quote from: "Malkom"
Quote from: "sparkythex"
you may already know this but i tried to call a card from a function & it still seeemed to stop the code.

Can you please explain? - once the GotoCard is called then the target card is loaded and the previous card goes out of focus and its local variables, procedures etc cannot be accessed until that card is loaded again.

main card function "switchcard"
Code: [Select]
@main card function switchcard
gotocard 5
this is was i was referring to it still doesn't work this way either.
Code: [Select]
@button 1 script on card 1
call switchcard
@ this code still not ran just like as if i had done the "gotocard 5" command directly
put append FieldCardFN(2,6)  onto NoCont1Var

what i had to do was
Code: [Select]
@ on card 1
gotocard 5
then
Code: [Select]
@ on card 5
@ all the code about
put append FieldCardFN(2,6)  onto NoCont1Var
@then
 gotocard 1

I would have figured you would have tried something like that.

Thats great you figured it out :)

Sorry I missed that you were using Call - Call is only for calling procedures - whereas GotoCard loads a card - it can be confusing