Home > Community > Forums > PCB SKILL > getting string from stdin or piport??

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 getting string from stdin or piport?? 

Last post Thu, Aug 9 2012 9:53 AM by DieFab. 4 replies.
Started by DieFab 08 Aug 2012 10:27 AM. Topic has 4 replies and 1600 views
Page 1 of 1 (5 items)
Sort Posts:
  • Wed, Aug 8 2012 10:27 AM

    • DieFab
    • Not Ranked
    • Joined on Tue, Jul 17 2012
    • Posts 4
    • Points 50
    getting string from stdin or piport?? Reply

    when I use "getc()" a new screen appears waiting for the user to type a character (I think this is the stdin) and that way a can get a character in my variable. But what should I do to get a string from the same input?? I'm trying using fscanf( inPort "%s" toing) and  gets( toing inPort )  but I don't know what sould i put instead of "inPort". The manual says that it should work if I just put nothing, but if I do so, my variable "toing" it's only showing a couple of double quotes no matter what I type.

    so what am I doing wrong??

    Thanks 

    Filed under:
    • Post Points: 20
  • Thu, Aug 9 2012 4:54 AM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,265
    • Points 21,720
    Re: getting string from stdin or piport?? Reply
    If this were C, you would use a "gets", the sklangref.pdf, doc\sklangref, seems to have a "gets" listed as well, you get the user input including the newline termination....
    • Post Points: 35
  • Thu, Aug 9 2012 5:13 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 283
    • Points 4,525
    Re: getting string from stdin or piport?? Reply

    gets(inPort) is not useful in a UI based program like Allegro. It only functions if you have a TELSKILL (set telskill) window open. If you have a need to get a string from the user try axlEnterString(?prompt l_prompts). You should only use gets if you are reading from a file.

    • Post Points: 5
  • Thu, Aug 9 2012 9:21 AM

    • DieFab
    • Not Ranked
    • Joined on Tue, Jul 17 2012
    • Posts 4
    • Points 50
    Re: getting string from stdin or piport?? Reply

    lots of thanks people from beyond, I was trying now with lineread(), but I'll verify what you're telling me to see what works better. Thanks again. Have a fantastic one.

    • Post Points: 5
  • Thu, Aug 9 2012 9:53 AM

    • DieFab
    • Not Ranked
    • Joined on Tue, Jul 17 2012
    • Posts 4
    • Points 50
    Re: getting string from stdin or piport?? Reply

    HEEEYY!! fxxffxxf!!! thats what I was looking for!! youre such a wonderfull person!! I hope good bless you with lots of children/.

    • Post Points: 5
Page 1 of 1 (5 items)
Sort Posts:
Started by DieFab at 08 Aug 2012 10:27 AM. Topic has 4 replies.