FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with Msgget()
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Problem with Msgget()
Posted: Sun Aug 21, 2011 07: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
Posts: 401
Joined: Thu Oct 06, 2005 10:15 PM
Re: Problem with Msgget()
Posted: Sun Aug 21, 2011 07:55 PM
Code (fw): Select all Collapse
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

------------------------------------------------------

*/
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Problem with Msgget()
Posted: Sun Aug 21, 2011 08: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
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Problem with Msgget()
Posted: Sun Aug 21, 2011 08:13 PM
pablovidal wrote:
Code (fw): Select all Collapse
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
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Problem with Msgget()
Posted: 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
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Problem with Msgget()
Posted: 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 (fw): Select all Collapse
   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)
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Problem with Msgget()
Posted: Mon Aug 22, 2011 03:53 PM

THANKS JEFF

FWH .. BC582.. xharbour

Continue the discussion