Problem with Msgget()

Problem with Msgget()

Postby MdaSolution » Sun Aug 21, 2011 7:30 pm

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 ?
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Problem with Msgget()

Postby pablovidal » Sun Aug 21, 2011 7:55 pm

Code: Select all  Expand view

Local cSerial := space(20)

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

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

 
Saludos,

Pablo Alberto Vidal
/*
------------------------------------------------------
Harbour 3.2.0, Fivewin 17.02, BCC7
------------------------------------------------------
*/
User avatar
pablovidal
 
Posts: 401
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana

Re: Problem with Msgget()

Postby MdaSolution » Sun Aug 21, 2011 8:08 pm

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")
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Problem with Msgget()

Postby MdaSolution » Sun Aug 21, 2011 8:13 pm

pablovidal wrote:
Code: Select all  Expand view

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
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Problem with Msgget()

Postby FranciscoA » Sun Aug 21, 2011 10:08 pm

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.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Problem with Msgget()

Postby Jeff Barnes » Mon Aug 22, 2011 12:29 pm

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  Expand view

   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
 
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Problem with Msgget()

Postby MdaSolution » Mon Aug 22, 2011 3:53 pm

THANKS JEFF
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests