AlphaCool USB and CoolBasic ?

Community home and general chat.
Post Reply
sapajou
Newcomer
Posts: 6
Joined: Sun Nov 18, 2007 10:46 am
Location: PARIS

AlphaCool USB and CoolBasic ?

Post by sapajou »

Hello,
I just discovered CoolBasic, the compiler is exactly what I was looking for to replace QBasic 16 bits, virtually Useless avexc XP. Visual Basic is too complicated for me, there are plenty of screen and I do not see how to use them.
My application is to write a command file to record TV shows without going through the screen
But plasma with a small LCD USB 200x64 ALPHACOOL.
I have DVBViewer (10 euros! Is given), which is very good, stable, gives a flawless, but the screen LCD is not integrated.
So I thought create the command records TV separately.
The software LCDHype interface ALPHACOOL my screen, but I do not know about how to program the software to use my Remote Microsoft.
I did a program with CoolBasic who created this file, but without the display on the LCD.
For the moment, I can always use a 2nd PC connected to the PC multimedia ethernet to create this file.
I saw on using CoolBasic (very good and made more accessible permanently) instruction CallDLL, can Order by this instruction my LCD?
If anyone knows the solution, it would be with pleasure.
I take this opportunity to congratulate the author of this compiler. Its implementation is really easy.
Why make complicated when one can make Singles!.
------- Composition my Media Center -------------------------------------- -------
CM ASUS M2NPV-VM, ATHLON64 3500 +, Ram 1Gb, Plextor double layer DVD, Tuner Terratec Cinergy 2400 DT MCE, LCD USB Alphacool 200 x64, DD 80 GB + 250 GB, Alim Fortron 400w, Microsoft 2005 with remote IR receiver USB
User avatar
Jare
Devoted Member
Posts: 877
Joined: Mon Aug 27, 2007 10:18 pm
Location: Pori
Contact:

Re: AlphaCool USB and CoolBasic ?

Post by Jare »

Sorry but if i got it right, it might be impossible. CoolBasic's DLL-support is very limited. If I remember right, you can only call a functions inside a DLL and give it two memory blocks. The first block contains input data for the function and the second is for the function return value. So I'm not sure if the DLL provided by your product can be accessed via CoolBasic.

There would be another way if your product had an executable which takes parameters and can be controlled that way. If there is that kind of exe, you can use Coolbasic's Execute command which will take the executable's path and parametres (like Execute "C:\Program Files\Product\Executable.exe -command -cmd_param1 -cmd_paramN").
sapajou
Newcomer
Posts: 6
Joined: Sun Nov 18, 2007 10:46 am
Location: PARIS

Re: AlphaCool USB and CoolBasic ?

Post by sapajou »

Jare wrote:There would be another way if your product had an executable which takes parameters and can be controlled that way. If there is that kind of exe, you can use Coolbasic's Execute command which will take the executable's path and parametres (like Execute "C:\Program Files\Product\Executable.exe -command -cmd_param1 -cmd_paramN").
Hello Jare,
Thank you very much for giving me responded.
I thought about this solution, but for CoolBasic with instruction CommandLine. The problem is that the parameter is accessible but after executing it is not retrieves the parameter changed.
For example:
I just want to use the function WaitKey of CoolBasic
Lecture.exe parametre ' appeal of pgm CoolBasic

'Seizure of a caractere
Repeat
Lu = WaitKey ()
Until read <> 0
Print "lu=" + (lu) Int ' test
'Command, which would be useful
'Return of paramètre
paramètre = int (lu)
End

Best wishes.
Excuse me for using a translator.
User avatar
Jare
Devoted Member
Posts: 877
Joined: Mon Aug 27, 2007 10:18 pm
Location: Pori
Contact:

Re: AlphaCool USB and CoolBasic ?

Post by Jare »

Maybe you are looking for solution like this? This lets you type the parameter(s) you want and after hitting Enter it executes ProgramName.exe with the parameter(s).

Code: Select all

Repeat
    parameter$ = Input("Type parameter: ")
Until KeyHit(cbKeyReturn)
CloseInput
Execute "c:\ProgramFiles\ProgramName\ProgramName.exe parameter$"
sapajou
Newcomer
Posts: 6
Joined: Sun Nov 18, 2007 10:46 am
Location: PARIS

Re: AlphaCool USB and CoolBasic ?

Post by sapajou »

I understand your answer, but in my case the pgm CoolBasic is launched inside the pgm LCDHype.

Launching LCDHype

However ...

Call pgm CoolBasic (seizure of a character)

Instructions (treatment of the character before)

However ...

End pgm LCDHype

There may be another solution that CoolBasic to retrieve a character before?
Thanks for your help.
User avatar
Jare
Devoted Member
Posts: 877
Joined: Mon Aug 27, 2007 10:18 pm
Location: Pori
Contact:

Re: AlphaCool USB and CoolBasic ?

Post by Jare »

Sorry, but now I really don't understand at all. :oops: Maybe someone else (who is wiser than me) can help with this? Anyone? :D

But if it helps, just taking a character from a string goes this way:

Code: Select all

myString$ = "ABCDE"
index = 3 'Characters index in the string
myCharacter$ = Mid(myString,index,1) 'Mid() function takes three parameters: string where seizure the character(s) from; from which character index to start; and how many characters to pick (in our case, one character)
print myCharacter 'Will print C when index is 3
Hopefully you'll get an answer to your proglem!
sapajou
Newcomer
Posts: 6
Joined: Sun Nov 18, 2007 10:46 am
Location: PARIS

Re: AlphaCool USB and CoolBasic ?

Post by sapajou »

I finally found a solution, it's not pretty but it works.
I use a temporary file to store my character.
Using a memory area it would be better, but I do not know.
Best wishes.


/ ======== PGM appelant LCDHype ========= /
ID=
//ScreenDef
Title=Sans titre
SpecCharFile=
#Header
/insert header code here/
%DefVar(lg,global=0)
%DefVar(lu,global=0)

%System.Execute('C:\lu.EXE',,10000)

#EndHeader

#GfxMode
%Assign(lg,0)
%Loop.While(%lg() = 0)
{
%Assign(lu,%System.ReadFile('C:\temp.txt',0))
%Assign(lg,%String.Length(%lu()))
}
%Common.CreateNewLine()
'Caractere saiasi= '%lu()

#EndGfxMode

'==== Saisie d un caractere /temp.txt ========
fic1$="C:\temp.txt"
vide$="**"
f1=OpenToWrite(fic1$)
WriteLine f1,vide$
CloseFile f1
f1=OpenToWrite(fic1$)
Repeat
lu=WaitKey()
Until lu <> ""
WriteLine f1,lu
CloseFile f1
End
rafleo

Re: AlphaCool USB and CoolBasic ?

Post by rafleo »

if you need an easy programming language with a good dll support, maybe AHK (AutoHotkey) may be the right solution.
It doesn't help you making 2D screen operations, but the members of the forum surely know what to do in your case.

you sould maybe take a look. what i'm doing is combining ahk and coolbasic, by letting ahk call dlls and putting variables into files
and then getting coolbasic to retrieve the variables and handle them.

it's not the best solution, but it nearly always works...
sapajou
Newcomer
Posts: 6
Joined: Sun Nov 18, 2007 10:46 am
Location: PARIS

Re: AlphaCool USB and CoolBasic ?

Post by sapajou »

Indeed with AutoHotKey I think it is possible to find a more "elegant"
I will look at it more closely, because my solution I do not like.
Thank you very much for your suggestion.
Post Reply