Hi, i am making a blackjack program in Visual Basic for a college project, in order to generate a random card each time, i need to make a random number, after numerous failures to do this using VB, i have made a small program in C++ that generates a random number to a text file when it is executed. The C++ program works on its own but when i try to execute it using VB's shell() function it seems to work, as a console window flashes on screen, but the actual program does not run correctly, as the random number in the text file is always the same. Does anyone have any ideas on how to make this program work as it should when called from VB ?
bops
1
Posting Whiz in Training
Recommended Answers
Jump to Postwhy don't you random number using VB, why using C++ random number ?
Jump to Postmaybe something wrong with your C++ code, can you post your C++ random number code, and also check your "\random.txt", if there something wrong with the file.
--------------------------------------------------------
and here how to random number in VBRandomize RandomNumber = Int(Rnd * 10)
this code is random …
Jump to Posthow many line in your text file ?
All 10 Replies
bops
1
Posting Whiz in Training
invisal
381
Search and Destroy
bops
1
Posting Whiz in Training
invisal
381
Search and Destroy
bops
1
Posting Whiz in Training
invisal
381
Search and Destroy
bops
1
Posting Whiz in Training
Comatose
290
Taboo Programmer
Team Colleague
invisal
381
Search and Destroy
bops
1
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.