Page 1 of 1

Problem with Msgget()

Posted: Sun Aug 21, 2011 7:30 pm
by MdaSolution
I must insert on msgget a number serial

sample : -1974753522

on my application I use

MsgGet("Key Generator","Enter Serial Number: ",@nSerial)

but when I try to insert the serial number it make error because I can insert only -197475352

and I cannot insert the last "2"


WHY ?

Re: Problem with Msgget()

Posted: Sun Aug 21, 2011 7:55 pm
by pablovidal

Code: Select all

Local cSerial := space(20)

MsgGet("Key Generator","Enter Serial Number: ",@cSerial)

nSerial := ( Val( cSerial )*-1 ) // Aqui esta numero en negativo

 

Re: Problem with Msgget()

Posted: Sun Aug 21, 2011 8:08 pm
by MdaSolution
Sorry
do you use key gen of Jeff Barnes ?

I not use a text value but nserial is a number and on init is = 0
I have

if Empty(nKey)
lVisable:=.t.
nKey:=1
nSerial:=0
MsgGet("Key Generator","Enter Key: ",@nKey)
MsgGet("Key Generator","Enter Serial Number: ",@nSerial)
MsgGet("Key Generator","Number of Licenses: ",@nLicense)
endif



If I must insert the serial -1974753522

it not take the last digit ( "2")

Re: Problem with Msgget()

Posted: Sun Aug 21, 2011 8:13 pm
by MdaSolution
pablovidal wrote:

Code: Select all

Local cSerial := space(20)

MsgGet("Key Generator","Enter Serial Number: ",@cSerial)

nSerial := ( Val( cSerial )*-1 ) // Aqui esta numero en negativo

 

Pablo I try with your modify but the result is too different

Serial Number: 1974753522 instead of -1974753522

and then the key is another because it have a positive number

Key: 573-5292123-4377-1230

Re: Problem with Msgget()

Posted: Sun Aug 21, 2011 10:08 pm
by FranciscoA
Hola, ¿y así?...
local cSerial:=space(20), nSerial:=0

MsgGet("Key Generator","Enter Serial Number",@cSerial)
MsgInfo( nSerial:=Val(alltrim(cSerial)) )
MsgInfo(Valtype(nSerial))

Saludos.

Re: Problem with Msgget()

Posted: Mon Aug 22, 2011 12:29 pm
by Jeff Barnes
In the MakeKey() function, change nSerial to a larger number.

When the MsgGet() pops up, just delete all the 9's and enter your -1974753522.

Code: Select all

   if Empty(nKey)
      lVisable:=.t.
      nKey:=1
      nSerial:=999999999999999
      MsgGet("Key Generator","Enter Key: ",@nKey)
      MsgGet("Key Generator","Enter Serial Number: ",@nSerial)
      MsgGet("Key Generator","Number of Licenses: ",@nLicense)
   endif
 

Re: Problem with Msgget()

Posted: Mon Aug 22, 2011 3:53 pm
by MdaSolution
THANKS JEFF