| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jul 13, 2003 1:21 pm Post subject: Built In Console Support |
|
|
I'd like to see VDS have the built in ability to have support for making
console applications. Currently it is only available using the VDSSTDIO.DLL
and that can be unstable.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sun Jul 13, 2003 1:29 pm Post subject: |
|
|
I dont know if this happens since dos and console only applications are dying . some developers even say that they dont support a dying OS like win 98 _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jul 13, 2003 5:43 pm Post subject: |
|
|
I'm talking about DOS console applications, ones such as Telnet.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Mon Jul 14, 2003 2:03 am Post subject: |
|
|
OK  _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Jul 14, 2003 2:14 pm Post subject: |
|
|
| FreezingFire wrote: | I'm talking about DOS console applications, ones such as Telnet.  |
Umm, The name of the language that this forum is for is called | Quote: | | VISUAL Dialog Script | VDS for short hehehehehehe _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jul 14, 2003 2:32 pm Post subject: |
|
|
Umm I am talking about making a console application in VDS. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Jul 14, 2003 2:53 pm Post subject: |
|
|
| FreezingFire wrote: | | Umm I am talking about making a console application in VDS. |
But the language was never meant to make console applications hence the word "Visual" in Visual Dialog Script but I think you may be able to use the new PIPE capabilities of VDS 5 to achieve something similar to a console application. Your best bet would be to transfer the data between your Exe and a console screen. To make a VDS app that is a pure console application is not possible. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jul 14, 2003 2:57 pm Post subject: |
|
|
Well look at the VDSSTDIO.DLL and it is possible. My wish was to have it
built into VDS itself so it would be more stable.
I think it's not possible to entirely depend on the name of the language
anymore to see what its capabilities are. VDS is much more than a simple
batch scripting application now. Also I count a console application as
'visual' because you can see it, it's not heard, smelled, or felt.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Jul 14, 2003 5:13 pm Post subject: |
|
|
| FreezingFire wrote: | Well look at the VDSSTDIO.DLL and it is possible. My wish was to have it
built into VDS itself so it would be more stable.
I think it's not possible to entirely depend on the name of the language
anymore to see what its capabilities are. VDS is much more than a simple
batch scripting application now. Also I count a console application as
'visual' because you can see it, it's not heard, smelled, or felt.  |
Actually Visual in Visual Dialog Script means you build your application visually. But I was just trying to make a poorly constructed joke here When you use VDSSTDIO.DLL the dll is making the console by using the AllocConsole function from the kernel32.dll and this is not VDS. You can do exactly what VDSSTDIO.DLL does but you would need VDS 5 or Gadget and an understanding of the console functions in the kernel32.dll... So to help you get started I wrote a short little example for ya. It is still not complete and I still need to fix something about it but maybe you can take it from here.
| Code: | %%STD_INPUT_HANDLE = -10
%%STD_OUTPUT_HANDLE = -11
%%STD_ERROR_HANDLE = -12
%%FOREGROUND_BLUE = $1
%%FOREGROUND_GREEN = $2
%%FOREGROUND_RED = $4
%%FOREGROUND_INTENSITY = $8
%%BACKGROUND_BLUE = $10
%%BACKGROUND_GREEN = $20
%%BACKGROUND_RED = $40
%%BACKGROUND_INTENSITY = $80
%%ENABLE_LINE_INPUT = $2
%%ENABLE_ECHO_INPUT = $4
%%ENABLE_MOUSE_INPUT = $10
%%ENABLE_PROCESSED_INPUT = $1
%%ENABLE_WINDOW_INPUT = $8
%%ENABLE_PROCESSED_OUTPUT = $1
%%ENABLE_WRAP_AT_EOL_OUTPUT = $2
LoadLib kernel32.dll
%A = @lib(kernel32,AllocConsole,INT:)
%A = @lib(kernel32,SetConsoleTitleA,INT:,STR:Hello VDS Console User)
%%hConsoleIn = @lib(kernel32,GetStdHandle,INT:,%%STD_INPUT_HANDLE)
%%hConsoleOut = @lib(kernel32,GetStdHandle,INT:,%%STD_OUTPUT_HANDLE)
%%hConsoleErr = @lib(kernel32,GetStdHandle,INT:,%%STD_ERROR_HANDLE)
%A = @lib(kernel32,SetConsoleMode,INT:,%%hConsoleIn,@Sum(%%ENABLE_LINE_INPUT,%%ENABLE_ECHO_INPUT))
%A = @lib(kernel32,SetConsoleTextAttribute,INT:,%%hConsoleIn,@Sum(%%FOREGROUND_RED,%%FOREGROUND_GREEN,%%FOREGROUND_BLUE,%%FOREGROUND_INTENSITY,%%BACKGROUND_BLUE))
%B = Welcome to the VDS console Demo@LF()
%D = @binary(dword,0)
%A = @lib(kernel32,WriteConsoleA,INT:,%%hConsoleOut,@addr("%B"),@sum(@len(%B),1),@addr("%D"),NIL:)
%A = @lib(kernel32,SetConsoleTextAttribute,INT:,%%hConsoleIn,@Sum(%%FOREGROUND_RED,%%FOREGROUND_GREEN,%%FOREGROUND_BLUE))
%B = Please enter your name-->
%A = @lib(kernel32,WriteConsoleA,INT:,%%hConsoleOut,@addr("%B"),@sum(@len(%B),1),@addr("%D"),NIL:)
%C = @fill(256,@chr(0))
%D = @binary(dword,0)
%A = @lib(kernel32,ReadConsoleA,INT:,%%hConsoleIn,@addr("%C"),256,@addr("%D"),NIL:)
Info Welcome @trim(@substr(%C,1,@len(%C)))@CR()
%A = @lib(kernel32,FreeConsole,INT:)
Freelib kernel32
|
Anyway have fun...Console users  _________________ Home of
Give VDS a new purpose!

Last edited by vdsalchemist on Tue Jul 15, 2003 2:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jul 14, 2003 7:07 pm Post subject: |
|
|
Sorry about being a little stern in my above posts... I guess I
misunderstood. It was my fault.
I'm really impressed by your example and I am going to really look into
this, I was not aware that this could be done by using APIs!!
Thanks a lot Mindpower!!!!  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Jul 14, 2003 7:16 pm Post subject: |
|
|
| FreezingFire wrote: | Sorry about being a little stern in my above posts... I guess I
misunderstood. It was my fault.
I'm really impressed by your example and I am going to really look into
this, I was not aware that this could be done by using APIs!!
Thanks a lot Mindpower!!!!  |
Well now you owe me FF for making me take a perfectly good 32bit app and downgrading it to a simple console app... The shame
Anyway just about anything that Windows can do can be done with VDS 5 and/or Gadget. The win32 API is very extensive and covers everything that the OS can do and now that VDS has access to the Win32 API you can build apps just like other languages. There is only a few missing parts in VDS 5 and the next versions of Gadget will take care of those.
Your wish is my command but next time rub the lamp a little gentler ok...I was trying to get this script finished for ya when you first posted the wish... If you need a script like this in the future you can get my undivided attention by going to the VDS online help site and get premium support if you need a faster turn around hehehehehehe _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 14, 2003 10:13 pm Post subject: |
|
|
I get an error at line 32.
"Error: Error calling library function
at line: 32
in file: untitled.dsc"
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jul 14, 2003 10:54 pm Post subject: |
|
|
What version of Windows are you using? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Jul 15, 2003 4:21 am Post subject: |
|
|
| Garrett wrote: | I get an error at line 32.
"Error: Error calling library function
at line: 32
in file: untitled.dsc"
-Garrett |
Umm... Did you save the script first? Why did the error say untitled.dsc? I think the line is the @fill(256,@chr(0)) or it may be the one just below that one. Any of the functions that deal with strings will be in 2 different flavors either the ANSI or the Wide character versions but if you are using a non-Unicode version of Windows you may have to drop the letter A off the name of the function for it to work but I do believe that all these functions should work for Win9x. I guess I should go look on MSDN. Anyway try them without the letter A at the end of the function name and let me know. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|