AllExperts > FoxPro 
Search      
FoxPro
Volunteer
Answers to thousands of questions
 Home · More FoxPro Questions · Answer Library  · Encyclopedia ·
More FoxPro Answers
Question Library

Ask a question about FoxPro
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Markish
Expertise
I can answer general questions related to Foxpro from Version 2.0 to 9.0. I'll try to answer them as quickly as possible.

Experience
I've been into Dbase programming from age of 11. I've worked in versions from FoxPro 2.0 and Foxbase.
Education/Credentials
I've done my B.Tech (IT) with distinction from Anna University, Chennai - India.

 
   

You are here:  Experts > Computing/Technology > Databases > FoxPro > Foxbase + Rev 2.00

FoxPro - Foxbase + Rev 2.00


Expert: Markish - 9/9/2008

Question
I am using foxbase+ Rev 2.00 version
I need to generate random numbers in my record
IF user enter Rs.125000 For 100 Records and min value and
maximum value per records
System should generate Rs.125000 for 100 records with various numbers total should be exactly Rs.125000 for 100 records.
Please give me a code for generating random numbers
i tried with rand() function but it is not working in my version. I used clipper plink86 for convert prg file to exe file.

I need change font size or print in bold in Dot matrix printer by using command (Set devic to print)
Char() function is used for condensed mode
please tell me a function for changing font size or bold.
Eg. If i print bill company name should be print bold with big font size than the address.
reply me soon as possible
with regards,
L.sampath kumar

Answer
Hi Sampath,
   Sorry for the delay in my response. As far as I understand your question, you need to split some amount into some 100 records randomly. If that is the case you can use the following code.

mamt=125000  && Amount to be split
minamt=1000
maxamt=50000
use tableA
stor 0 to mnamt,tempamt
ct=1
count to trec
go top
do while !eof()
  if ct<>tct
     mnamt=INT((maxamt- minamt+ 1) * RAND( ) + minamt)
     tempamt=tempamt+mamt
  else
     mnamt=mamt-tempamt
  endif
  repl amount with mnamt
  ct=ct+1
  skip
enddo

For changing the fonts in the printing, you need to use the escape control characters depending on your priter. You need to refer the hardware manual of the printer.

Hope this helps..
Best regards,
Markish

http://markishonline.com


Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.