From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,212740d5951bd181 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-24 05:32:01 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!wanadoo.fr!freenix!enst!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: String handling??? Date: Sun, 24 Jun 2001 07:30:34 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <3B362243.EA4AA94E@ida.his.se> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 993385920 18146 137.194.161.2 (24 Jun 2001 12:32:00 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sun, 24 Jun 2001 12:32:00 +0000 (UTC) Cc: To: Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.4 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:9070 Date: 2001-06-24T07:30:34-05:00 There is no sprint function in any C library of which I am aware. You are probably thinking of sprintf, but even that function is of no help in extracting numbers from a string. To do that, in C, one would use scanf, or one of its companion xscanf functions. That said, to do the same thing in Ada, one would make use of the 'Value attribute of the corresponding numeric type to obtain the numeric value from its string representation. For example, to obtain the numeric value from a string of digits, one would use the Integer'Value function, passing the string as the argument. To tokenize a string (say, from a file), one would use the Find_Token procedure of the Ada.Strings.Fixed package. ----- Original Message ----- From: "Michael Andersson" Newsgroups: comp.lang.ada To: Sent: June 24, 2001 12:24 PM Subject: String handling??? > Hi! > I'm currently trying to write a text file parser from my collage project > and I'm looking for some functions i Ada that works like the sprint > function in C. Is there such a function? > The thing is that I want to extract numbers from a string and I don't > know how. > > Need your help, please! > /Michael Andersson > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >