stdin make a percentege bar help

New to FreeBASIC? Post your questions here.
Post Reply
honey data
Posts: 28
Joined: Feb 11, 2018 19:54
Location: portugal lisbon
Contact:

stdin make a percentege bar help

Post by honey data »

im want to make a percent bar using the char |

ibars.exe | ibar.exe

like
ibar.bas

Code: Select all

dim s as string
dim ss as string
dim i as integer
dim d as integer
dim c as integer=0



color 15,1
cls
open cons for input as #1
do
line input #1,s

if asc(s)>=asc("0") and asc(s)<=asc("9") then
d=0
d=val(s)
locate 1,1
print d;"%          ";
sleep 200
else
locate 2,1
print s;".             ";
sleep 200
end if

 if  eof(1) then exit do
loop


close #1



ibar.bat

Code: Select all

@echo off

echo 0 
echo geting ready 


echo 10 
echo p 10 


echo 20 
echo p 30 



echo 30 
echo p 30 



echo 40 
echo p 40 



echo 50 
echo p 50 


echo 60 
echo p 60 


echo 70 
echo p 70 



echo 80 
echo p 80 


echo 90 
echo p 90 


echo 100 
echo p 100 


@echo on

Last edited by honey data on Apr 27, 2018 23:40, edited 5 times in total.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: stdin make a percentege bar help

Post by MrSwiss »

Check out this thread: Text progress bar
honey data
Posts: 28
Joined: Feb 11, 2018 19:54
Location: portugal lisbon
Contact:

Re: stdin make a percentege bar help

Post by honey data »

thanks any way ,but percent bar like windows 3.1 im have https://github.com/honeydatax/freebasic ... ercent.bas

but im wat to learn to make a progress bar to dos bat like a drive like more program, thanks any way


but as freebasic drive to run at same time as my bat

like this in c
Last edited by honey data on Apr 27, 2018 23:41, edited 2 times in total.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: stdin make a percentege bar help

Post by MrSwiss »

Sorry, but why don't you simply forget it ... you are attempting: the impossible!

Reasons:
- Win = graphics screen / DOS = console (Text only), a minor hurdle
----------------------------------------------- knock-out criterion -----------------------------------------------
- StackOverflow (nothing to do with progress bar, just std-in), telling you:
"it can't be done: because, you don't know the stream-size, until after finish (reading stream)"
here: it should become obvious, that the raw DATA, for progress bar, isn't available !!!
(you absolutely must know: total size, before start!)
-------------------------------------------- knock-out criterion, end --------------------------------------------
- using Files, instead of std-in, is a different type of story, because the size can be got,
before the start of any other operation ...
honey data
Posts: 28
Joined: Feb 11, 2018 19:54
Location: portugal lisbon
Contact:

Re: stdin make a percentege bar help

Post by honey data »

thanks
Post Reply