Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

question about INPUT in QuickBASIC 4.5


  • Please log in to reply
3 replies to this topic

#1 jnk1296

jnk1296

  • Members
  • 150 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:39 PM

Posted 22 August 2010 - 02:55 AM

Hi. Is it possible to use INPUT with a string variable? And if so, can i use it like this:
INPUT "C:\" + RTRIM$(CurrentDirectory) + ">", Cmd$

RESULT : C:\QB45>

I am making a program that passes commands to the command interpreter, but i am having trouble with displaying the current directory.

Can anyone help me figure out how to do this. The problem is only with the INPUT command. Everything involving
RTRIM$(CurrentDirectory) is fine.

Using QuickBASIC 4.5 .

Thanks!

Edited by jnk1296, 22 August 2010 - 02:55 AM.


BC AdBot (Login to Remove)

 


#2 Eyesee

Eyesee

    Bleepin Teck Shop


  • BC Advisor
  • 3,539 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:In the middle of Kansas
  • Local time:04:39 PM

Posted 25 August 2010 - 05:12 PM

Its been a LONG time since I cut any QB code

INPUT expects a numeric data type
INKEY$ accepts string variables but expects input from the keyboard buffer
So does INPUT$()

What about something like this?
A$ = "C:\" + RTRIM$(CurrentDirectory) + ">", Cmd$
PRINT A$

Edited by Eyesee, 25 August 2010 - 05:17 PM.

In the beginning there was the command line.

#3 jnk1296

jnk1296
  • Topic Starter

  • Members
  • 150 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:39 PM

Posted 25 August 2010 - 07:14 PM

Thank you for your help. But i finally found a combo that worked for me:

PRINT "C:\" + RTRIM$(CurrentDirectory); INPUT ">", CMD$

the code above may not be 100% correct since it's just off the top of my head. :thumbsup: But it worked!
But again, thanks!

Now if i could just get it to compile!

#4 Eyesee

Eyesee

    Bleepin Teck Shop


  • BC Advisor
  • 3,539 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:In the middle of Kansas
  • Local time:04:39 PM

Posted 26 August 2010 - 11:44 AM

Cool!

I used to LOVE Quick Basic!
Not very many people use it anymore
In the beginning there was the command line.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users