dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Apr 16, 1998

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Read specific number of chars from file

Question:
I am a rookie at PowerBuilder. I use PB 5, and I can't seem to find a function that reads a specific number of chars from a file into a string. I saw that I can read the whole file into a string, but suppose I want to read five characters from the file. How can I do it? Is it even possible?

Answer:
PowerBuilder's file functions are stream- and line-based. Your only options are to read in a single line (terminated by ~r~n) from a file or up to a maximum of 32,767 characters to the end of the file.

With these two simple functions you can achieve most tasks. If you want the first five characters, then you can use either of the above methods to read in a chunk of data and then just use the Left function to get the characters you want.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date