Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Jul 24, 2017 3:36 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: I need a Idea ToDo this
PostPosted: Tue Mar 12, 2013 9:03 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
I need to make some algorithm to approve credit to some customers.

When the employee called the owner to see if the credit approved as the owner runs a small APPLICATION or a mathematical calculation and gives the approval number that customer credit.

Something like that is the idea

:idea:

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: I need a Idea ToDo this
PostPosted: Wed Mar 13, 2013 1:48 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Really not enough information.

Based on just that:

constant  CredLimit as double = 1000.00
If (AmountCurrentlyOwed + AMountBeingAskedFor) < CredLimit then
msgbox "Approve"
else
msgbox "Do not Approve : available credit = " + format (credLimit - AmountCurrentlyOwed,"0.00)
end if


Top
 Profile  
Reply with quote  
 Post subject: Re: I need a Idea ToDo this
PostPosted: Wed Mar 13, 2013 7:25 am 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
no is no that

what i need is like type off security to produce a security code
:?:

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: I need a Idea ToDo this
PostPosted: Wed Mar 13, 2013 10:26 am 
Offline

Joined: Sat Oct 01, 2005 9:55 am
Posts: 527
Sounds like a job for SSLSocket.


Top
 Profile  
Reply with quote  
 Post subject: Re: I need a Idea ToDo this
PostPosted: Wed Mar 13, 2013 3:39 pm 
Offline

Joined: Fri Nov 16, 2007 10:18 pm
Posts: 195
Location: Portland, OR
Sounds like you need a one off authorization code.

  • I would have the program generate a random number of the required digits.
  • Check a database to see if it was already used.
  • Repeat 1 and 2 as needed until you have a unique code.
  • Store the unique code in the database along with any customer details collected.

_________________
Windows: Win7 64bit sp1, Vista 32bit sp2, WinXP 32bit SP3
Linux: RH EL6
Mac: Died in 2011 and took 2 months to notice.

RealStudio: 2012r2


Top
 Profile  
Reply with quote  
 Post subject: Re: I need a Idea ToDo this
PostPosted: Wed Mar 13, 2013 3:46 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
Yes Bob

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: I need a Idea ToDo this
PostPosted: Wed Mar 13, 2013 5:44 pm 
Offline

Joined: Fri Nov 16, 2007 10:18 pm
Posts: 195
Location: Portland, OR
This is off the top of my head:

' This code would be under a generate button.

Dim r as New Random
Dim u as Double

r.RandomizeSeed

Do
u = r.InRange(100000,999999) ' Going for six digit numbers here.
Loop Until uniqueVal(u)

Return u


Function uniqueVal(u As Double) As Boolean

' I'm assuming you have opened the database elsewhere.

Dim rs as RecordSet = db.SQLSelect("select * from discounttable where ID=""" + str(u) + """") ' Properly this should be a prepared statement.
If rs <> Nil then
Return False
Else
Return True
End If

End Function


You would update the database in the save button's event along with any other information in your form.

_________________
Windows: Win7 64bit sp1, Vista 32bit sp2, WinXP 32bit SP3
Linux: RH EL6
Mac: Died in 2011 and took 2 months to notice.

RealStudio: 2012r2


Top
 Profile  
Reply with quote  
 Post subject: Re: I need a Idea ToDo this
PostPosted: Wed Mar 13, 2013 8:03 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
thanks

:idea:

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group