FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

SYSTEM

Handle serial numbers


Is there anyway to make a dialog box that requires a certain serial # and then no longer displays a registration screen if the serial # has been entered. Also: Would it be possible to generate a different serial # & then I would re-compile the app. I remember this from awhile back, maybe even a year ago. Would it be possible then to display the serial # on the splash screen?

Brian


Of course the easiest way to do this is via Program Generator. Here's a starter if you get stuck:

local fn genpass$(thename$)
  result$ = thename$
'clear for length
  for lloop& = 1 to len(thename$)
    mid$(result$,(len(thename$)-lloop&)+1,1) = mid$(thename$,lloop&,1)
  next lloop&
'reverses the name as the password. Ie:
'name: Brian
'pass: nairB
end fn = result$
window #1,"Pass Entry",(0,0)-(320,240)
edit field #8,"name",(10,10)-(100,20)
edit field #9,"pass",(30,10)-(100,40)
'Now your window is open, and
'your edit fields are set up.
endoftime% = _false
do
  long if inkey$=chr$(13)
'wait for <RETURN> key
    myname$ = edit$(8)
    mypass$ = edit$(9)
'get contents of name/pass
    realpass$ = fn genpass$(myname$)
'generate the real password
'based on the name
    long if mypass$<>realpass$
      beep'wrong pass
    xelse
'right password
      window close #1
      endoftime% = _true
    end if
  end if
until endoftime%

all this is untested of course.
What you may also consider is generating your own prefs file.

<< Also: Would it be possible to generate a different serial # & then I would re-compile the app.
The above system ensures that you wouldn't have to "recompile" anything I remember this from awhile back, maybe even a year ago. Would it be possible then to display the serial # on the splash screen? >>

Unless you're writing the next Photoshop, don't even bother doing this. It just encourages someone to write down your username/pass when you're notlooking. but if your bent on doing this, just use the genpass fn to generate their password again.

TJ Grant


I encountered this exact situation with my STATsimple app., so here's what I did:
- Create a single splash PICT
- Create two DLOGS; one for an unregistered situation; one for registered
- In the registered DLOG, use the PICT and STATIC TEXT to display the ser#
- In the unregistered DLOG, use the PICT and 'Register' & 'Not Yet' button
- Create a 'registration' DLOG with an edit field for the serial number
+ Check for serial number at startup and display appropriate splash DLOG
+ If 'register' button selected, show 'registration' DLOG
# When it's time to publish a version that requires your clients to cough up some upgrade cash, change the encoding scheme of the serial number and recompile your app with the new scheme. New serial numbers will have to be issued.
Hope this helps or inspires a better way. E-mail me personally if you need any code for this.

_Chris