Publié : mar. 04/janv./2005 13:33
par Coolman
nico, pour certains languages, au lieu de tester, j'aurais du dire informer sur le web, c'est le cas pour ethosbasic, gfabasic et powerbasic quoique pour gfa j'avais une licence sous atarist, donc je connais bien, la version pc doit s'en approcher ce basic etait pour l'epoque excellent...
Pour clarifier, je n'ai pas testé powerbasic parce que je l'ai trouvé un peu cher 199$ pour un compilo basic, meme la version dos, mais il devrait y'avoir une version demo sur le site officiel (je crois l'avoir vu) ou alors peut etre que tu peux faire une demande sur leur site. bien qu'il soit cher, l'avantage de powerbasic d'apres ce que j'ai lu sur c'est les pack suplementaire base de donnee et outils divers qui facilitent la programmations egallement beaucoup d'activité autour de ce language...
Ouaf-Ouaf (amusant le pseudo), attention je ne suis pas en train de t'inciter a abandonner pure, je n'ignore pas que le changement d'un language peut etre tres fatiguant car il faut s'adapter a de nouvelles commandes et syntaxe quoiqu'en basic ce n'est pas difficile. cela dit, ca ne peut pas faire de mal de voir les alternatives, mais je suis d'accord concernant la doc dispo uniquement en anglais, d'ailleurs je l'ai dit, c'est l'un des avantages de pureb...
KarLKoX, la desolé, je ne suis pas d'accord, tu oublie la declaration obligatoire et tres precises des variables, les pointeurs en c, la gestion de la memoire qui n'est pas simple et puis les classes en c++, la programmation object, et la syntaxe (les boucles for-next, les parentheses necessaires...) que je trouve vraiment merdique et qui demande une memorisation de tous les instants, la declaration des libs, et je ne parlerais pas de la creation de l'interface, a moins d'acheter borland c++ ou visual c++ avec leurs ides, et la on va vers les milles euros pour un systeme de dev complet. avouez que ce serait ridicule d'acheter ca pour la creation de petits utilitaires.
Tiens un exemple de bcx tiré des exemples de sources console (dos) :
DIM K
CLS
FOR K = 0 TO 15
COLOR K,0
LOCATE 2+K,5,0
PRINT "Introducing BCX! The Basic To C Translator for Win32 by Kevin Diggins."
NEXT
COLOR 15,1
LOCATE 23,28,0
INPUT "Press Enter To End" , K
COLOR 7,0
CLS
Le source basic occupe environ 1 ko, croirez vous que la translation en c occupe environ 8 ko et il s'agit d'un simpe programme avec une boucle et affichage d'une ligne a differentes couleurs en mode texte, vous remarquerez locate, cls, color qui existent nativement avec la syntaxe bcx et egallement avec l'ancien quickbasic dos doit etre cree sous C...
bon, il est vrai que la translation n'est peut etre pas optimisé car formaté sur un shema precis par bcx, mais le resultas approche une programmation manuelle, j'ai eté optimiste en disant que la prog basic me prenait 2 fois moins de temps, je rectifie en disant qu'en fait parfois le gain en temps est 4 fois superieur...
// *************************************************************
// Created with BCX -- The BASIC To C Translator (ver 4.76)
// BCX (c) 1999, 2000, 2001, 2002, 2003, 2004 by Kevin Diggins
// *************************************************************
// Translated for compiling using the Lcc-Win32 Compiler
// *************************************************************
#include <conio.h>
#include <direct.h>
#include <ctype.h>
#include <io.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <time.h>
#include <stdarg.h>
#include <process.h>
// *************************************************
// System Variables
// *************************************************
COORD cursor;
HANDLE hConsole;
int color_fg = 7;
int color_bg = 0;
int ScanError;
char InputBuffer[1048576];
// *************************************************
// User Global Variables
// *************************************************
static int K;
// *************************************************
// Standard Prototypes
// *************************************************
void cls(void);
void color (int,int);
void locate (int,int,int=1,int=12);
char* BCX_TmpStr(size_t);
char* mid (char*, int, int=-1);
char* left (char*,int);
char* RemoveStr (char*,char*);
int instr(char*,char*,int=0,int=0);
char *_stristr_(char*,char*);
int scan (char *input, char *format, ... );
int Split (char [][2048], char*, char*, int=0);
// *************************************************
// Main Program
// *************************************************
int main(int argc, char *argv[])
{
hConsole = GetStdHandle (STD_OUTPUT_HANDLE);
cls();
for(K=0; K<=15; K+=1)
{
color (K,0 );
locate (2+K,5,0);
printf("%s\n","Introducing BCX! The Basic To C Translator for Win32 by Kevin Diggins.");
}
color (15,1 );
locate (23,28,0);
printf("Press Enter To End");
K=0;
gets(InputBuffer);
ScanError = scan(InputBuffer,"%d",&K);
*InputBuffer=0;
color (7,0 );
cls();
return 0; // End of main program
}
// *************************************************
// Run Time Functions
// *************************************************
char *BCX_TmpStr (size_t Bites)
{
static int StrCnt;
static char *StrFunc[2048];
StrCnt=(StrCnt + 1) & 2047;
if(StrFunc[StrCnt]) free (StrFunc[StrCnt]);
return StrFunc[StrCnt]=(char*)calloc(Bites+128,sizeof(char));
}
char *left (char *S, int length)
{
register int tmplen = strlen(S);
char *strtmp = BCX_TmpStr(tmplen);
strcpy (strtmp,S);
if(length>tmplen)
strtmp[tmplen] = 0;
else
strtmp[length] = 0;
return strtmp;
}
char *mid (char *S, int start, int length)
{
register int tmplen = strlen(S);
char *strtmp;
if(start>tmplen||start<1) return BCX_TmpStr(1);
if (length < 0) length = tmplen - start + 1;
strtmp = BCX_TmpStr(length);
strncpy(strtmp,&S[start-1],length);
strtmp[length] = 0;
return strtmp;
}
char *RemoveStr (char *a, char *b)
{
register int i, tmplen = strlen(b);
register char *strtmp = BCX_TmpStr(strlen(a));
strcpy(strtmp,a);
while(1)
{
i=instr(strtmp,b);
if(i==0) break;
strcpy(&strtmp[i-1],&strtmp[i+tmplen-1]);
}
return strtmp;
}
int instr(char* mane,char* match,int offset,int sensflag)
{
register char *s;
if (!mane || !match || ! *match || offset>(int)strlen(mane)) return 0;
if (sensflag)
s = _stristr_(offset>0 ? mane+offset-1 : mane,match);
else
s = strstr (offset>0 ? mane+offset-1 : mane,match);
return s ? (int)(s-mane)+1 : 0;
}
char *_stristr_(char *String, char *Pattern)
{
register char *pptr, *sptr, *start;
register UINT slen, plen;
for (start = (char *)String,
pptr = (char *)Pattern,
slen = strlen(String),
plen = strlen(Pattern);
slen >= plen;
start++, slen--)
{
while (toupper(*start) != toupper(*Pattern))
{
start++;
slen--;
if (slen < plen)
return(0);
}
sptr = start;
pptr = (char *)Pattern;
while (toupper(*sptr) == toupper(*pptr))
{
sptr++;
pptr++;
if (!*pptr) return (start);
}
}
return(0);
}
void locate (int row,int col,int show,int shape)
{
CONSOLE_CURSOR_INFO cci = {0};
cursor.X = col-1;
cursor.Y = row-1;
SetConsoleCursorPosition(hConsole,cursor);
cci.bVisible = show;
cci.dwSize = shape;
SetConsoleCursorInfo(hConsole,&cci);
}
void cls (void)
{
COORD coordScreen = {0,0};
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi = {0};
DWORD dwConSize;
register int attr;
cursor.X = 0;
cursor.Y = 0;
GetConsoleScreenBufferInfo( hConsole, &csbi );
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter (hConsole, 32, dwConSize,coordScreen, &cCharsWritten);
attr = color_fg + color_bg * 16;
FillConsoleOutputAttribute (hConsole, attr, dwConSize,coordScreen, &cCharsWritten);
locate(1,1,1);
}
void color (int fg, int bg)
{
SetConsoleTextAttribute (hConsole,fg+bg*16);
color_fg = fg;
color_bg = bg;
}
int scan(char *input, char *format, ... )
{
register int c,d ;
char *s_;
int *intptr;
float *floatptr;
double *doubleptr;
char *i = format;
char A[50][2048];
va_list marker;
c = 0;
d = Split(A,input,",");
va_start(marker, format); //Initialize arguments
while(d && *format)
{
if(*format == '%') format++;
if(*format == 's')
{
s_ = va_arg(marker, char *);
strcpy(s_, A[c]);
c++;
d--;
}
if(*format == 'd')
{
intptr = va_arg(marker, int *);
*intptr = atoi(A[c]);
c++;
d--;
}
if(*format == 'g')
{
floatptr = va_arg(marker, float *);
*floatptr = atof(A[c]);
c++;
d--;
}
if(*format == 'l')
{
format++;
doubleptr = va_arg(marker, double *);
*doubleptr = atof(A[c]);
c++;
d--;
}
format++;
}
va_end(marker); // Reset variable arguments
if(d) return(1); // More data than variables
if(*format == 0) return(0); // OK
return(-1); // More variables than data
}
int Split (char Buf[][2048], char *T, char *Delim, int Flg)
{
int Begin = 0;
int Count = 0;
int Quote = 0;
int Index = 0;
int lenT = strlen(T);
char Chr34[2]={34,0};
for(Index=1;Index<=lenT;Index++)
{
if(instr(Delim,mid(T,Index,1))&&!Quote)
{
strcpy(Buf[Count],(char*)mid(T,Begin,Index-Begin));
if ((Flg & 2) == 0) // 0 if old version
Count++;
else
if (Buf[Count][0] != 0) Count++;
Begin=0;
if((Flg & 1) == 1) // 1 if true
strcpy(Buf[Count++],(char*)mid(T,Index,1));
}
else
{
if(strcmp(mid(T,Index,1),Chr34)==0) Quote=!Quote;
if(Begin==0) Begin=Index;
}
}
if(Begin)
strcpy(Buf[Count++],(char*)mid(T,Begin,Index-Begin));
if((Flg & 1) == 0) // 0 if false
for(int i=0;i<=Count;i++) strcpy(Buf,(char*)RemoveStr(Buf,Chr34));
return Count;
}
Voici un autre exemple en bcx cette fois pour windows, creation d'une petite fenetre, centrage et avec un texte alert et changement fond ecran fenetre rouge et blanc alternativement, c'est assez simple en bcx (source environ 2ko) :
GUI "Alert"
GLOBAL TimerID
GLOBAL Change
GLOBAL Form1 AS CONTROL
GLOBAL Label AS CONTROL
SUB FORMLOAD
Form1 = BCX_FORM ("Alert",0,0,75,50)
Label = BCX_LABEL ("Alert",Form1,0,0,0,75,50)
TimerID = SetTimer (Form1, 1, 1000, NULL)
MODSTYLE (Form1,0,WS_MINIMIZEBOX|WS_SIZEBOX|WS_MAXIMIZEBOX,0)
MODSTYLE (Label,SS_CENTER OR SS_CENTERIMAGE)
BCX_SET_FONT Label, "Garamond", 28
CENTER (Form1)
SHOW (Form1)
END SUB
BEGIN EVENTS
SELECT CASE CBMSG
'***************
CASE WM_TIMER
'***************
IF wParam = 1 THEN
Change = NOT Change
InvalidateRect ( Label,0,TRUE ) ' Force a redraw
End If
'***************
CASE WM_CTLCOLORSTATIC ' Colorize our static text controls
'***************
IF (HANDLE) lParam = Label THEN
If Change Then
BCX_SET_LABEL_COLOR (Label,QBCOLOR(12),QBCOLOR(15))
ELSE
BCX_SET_LABEL_COLOR (Label,QBCOLOR(15),QBCOLOR(12))
END IF
END IF
'***************
CASE WM_DESTROY
'***************
KillTimer(hWnd,1)
PostQuitMessage(0)
EXIT FUNCTION
'***************
END SELECT
END EVENTS
Le resultas en C (source environ 12 ko) :
// *************************************************************
// Created with BCX -- The BASIC To C Translator (ver 4.76)
// BCX (c) 1999, 2000, 2001, 2002, 2003, 2004 by Kevin Diggins
// *************************************************************
// Translated for compiling using the Lcc-Win32 Compiler
// *************************************************************
#include <windows.h> // Win32 Header File
#include <windowsx.h> // Win32 Header File
#include <commctrl.h> // Win32 Header File
#include <mmsystem.h> // Win32 Header File
#include <shellapi.h> // Win32 Header File
#include <shlobj.h> // Win32 Header File
#include <richedit.h> // Win32 Header File
#include <wchar.h> // Win32 Header File
#include <objbase.h> // Win32 Header File
#include <ocidl.h> // Win32 Header File
#include <winuser.h> // Win32 Header File
#include <olectl.h> // Win32 Header File
#include <oaidl.h> // Win32 Header File
#include <ole2.h> // Win32 Header File
#include <oleauto.h> // Win32 Header File
#include <conio.h>
#include <direct.h>
#include <ctype.h>
#include <io.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <time.h>
#include <stdarg.h>
#include <process.h>
// *************************************************
// User Global Variables
// *************************************************
static HINSTANCE BCX_hInstance;
static int BCX_ScaleX;
static int BCX_ScaleY;
static char BCX_ClassName[2048];
static int TimerID;
static int Change;
static HWND Form1;
static HWND Label;
// *************************************************
// Standard Macros
// *************************************************
#define BOR |
#define Show(Window)RedrawWindow(Window,0,0,0);ShowWindow(Window,SW_SHOW);
// *************************************************
// Standard Prototypes
// *************************************************
HWND BCX_Form(char*,int=0,int=0,int=250,int=150,int=0,int=0);
HWND BCX_Label(char*,HWND,int=0,int=0,int=0,int=0,int=0,int=0,int=0);
HFONT BCX_Set_Font (char *,int,int=0,int=0,int=0,int=0);
int qbcolor (int);
LRESULT Set_Color (int,int,int,int);
void Center (HWND,HWND=0,HWND=0);
BOOL ModStyle (HWND, DWORD=0, DWORD=0, BOOL=0);
// *************************************************
// User Prototypes
// *************************************************
void FormLoad (void);
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
// **********************************
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR CmdLine,int CmdShow)
{
WNDCLASS Wc;
MSG Msg;
// *****************************
strcpy(BCX_ClassName,"Alert");
// ************************************
// Scale Dialog Units To Screen Units
// ************************************
RECT rc = {0,0,4,8};
MapDialogRect (NULL,&rc);
BCX_ScaleX = rc.right/2;
BCX_ScaleY = rc.bottom/4;
BCX_hInstance = hInst;
// ******************************************************
Wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
Wc.lpfnWndProc = WndProc;
Wc.cbClsExtra = 0;
Wc.cbWndExtra = 0;
Wc.hInstance = hInst;
Wc.hIcon = LoadIcon(NULL,IDI_WINLOGO);
Wc.hCursor = LoadCursor(NULL,IDC_ARROW);
Wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
Wc.lpszMenuName = NULL;
Wc.lpszClassName = BCX_ClassName;
RegisterClass(&Wc);
INITCOMMONCONTROLSEX iccex;
iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
// ******************************************
iccex.dwICC =
ICC_LISTVIEW_CLASSES |
ICC_TREEVIEW_CLASSES |
ICC_BAR_CLASSES |
ICC_TAB_CLASSES |
ICC_UPDOWN_CLASS |
ICC_PROGRESS_CLASS |
ICC_USEREX_CLASSES |
ICC_DATE_CLASSES;
InitCommonControlsEx(&iccex);
// ******************************************
FormLoad();
// ******************************************
while(GetMessage(&Msg,NULL,0,0))
{
HWND hActiveWindow = GetActiveWindow();
if(!IsWindow(hActiveWindow) || !IsDialogMessage(hActiveWindow,&Msg))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}
return Msg.wParam;
}
// *************************************************
// Run Time Functions
// *************************************************
void Center (HWND hwnd, HWND Xhwnd, HWND Yhwnd)
{
RECT rect, rectP;
int x, y, width, height;
int screenwidth, screenheight;
if(Xhwnd==0)
{
RECT DesktopArea;
RECT rc;
SystemParametersInfo(SPI_GETWORKAREA,0,&DesktopArea,0);
GetWindowRect(hwnd,&rc);
SetWindowPos(hwnd,HWND_TOP,
((DesktopArea.right-DesktopArea.left)-(rc.right-rc.left))/2+
DesktopArea.left,((DesktopArea.bottom-DesktopArea.top)-
(rc.bottom-rc.top))/2 + DesktopArea.top,0,0,SWP_NOSIZE);
return;
}
GetWindowRect (hwnd,&rect);
GetWindowRect (Xhwnd,&rectP);
width = rect.right-rect.left;
x = ((rectP.right-rectP.left)-width)/2 + rectP.left;
if(Yhwnd==NULL)
{
height = rect.bottom-rect.top;
y = ((rectP.bottom-rectP.top)-height)/2 + rectP.top;
}
else
{
GetWindowRect(Yhwnd,&rectP);
height = rect.bottom-rect.top;
y = ((rectP.bottom-rectP.top)-height)/2+rectP.top;
}
screenwidth = GetSystemMetrics(SM_CXSCREEN);
screenheight = GetSystemMetrics(SM_CYSCREEN);
if ((x<0)) x=0;
if ((y<0)) y=0;
if ((x+width>screenwidth)) x = screenwidth-width;
if ((y+height>screenheight)) y = screenheight-height;
MoveWindow (hwnd, x, y, width, height, FALSE);
}
HWND BCX_Form
(char *Caption,
int X,
int Y,
int W,
int H,
int Style,
int Exstyle)
{
HWND A;
if(!Style)
{
Style= WS_MINIMIZEBOX |
WS_SIZEBOX |
WS_CAPTION |
WS_MAXIMIZEBOX |
WS_POPUP |
WS_SYSMENU;
}
A = CreateWindowEx(Exstyle,BCX_ClassName,Caption,
Style,
X*BCX_ScaleX,
Y*BCX_ScaleY,
(4+W)*BCX_ScaleX,
(12+H)*BCX_ScaleY,
NULL,(HMENU)NULL,BCX_hInstance,NULL);
SendMessage(A,(UINT)WM_SETFONT,(WPARAM)GetStockObject
(DEFAULT_GUI_FONT),(LPARAM)MAKELPARAM(FALSE,0));
return A;
}
BOOL ModStyle(HWND hWnd, DWORD dwAdd, DWORD dwRemove, BOOL bEx)
{
SetLastError(0);
DWORD dwStyle = GetWindowLong(hWnd,(bEx ? GWL_EXSTYLE:GWL_STYLE));
DWORD dwNewStyle = (dwStyle & (~dwRemove)) | dwAdd;
SetWindowLong(hWnd, (bEx ? GWL_EXSTYLE : GWL_STYLE),dwNewStyle);
SetWindowPos(hWnd,NULL,0,0,0,0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_FRAMECHANGED);
return (GetLastError() == 0);
}
HWND BCX_Label
(char* Text,HWND hWnd,int id,int X,int Y,int W,int H,int Style,int Exstyle)
{
HWND A;
if(!Style)
{
Style=WS_CHILD | SS_NOTIFY | SS_LEFT | WS_VISIBLE;
}
A = CreateWindowEx(Exstyle,"static",Text,Style,
X*BCX_ScaleX, Y*BCX_ScaleY, W*BCX_ScaleX, H*BCX_ScaleY,
hWnd,(HMENU)id,BCX_hInstance,NULL);
SendMessage(A,(UINT)WM_SETFONT,(WPARAM)GetStockObject
(DEFAULT_GUI_FONT),(LPARAM)MAKELPARAM(FALSE,0));
if (W==0)
{
HDC hdc=GetDC(A);
SIZE size;
GetTextExtentPoint32(hdc,Text,strlen(Text),&size);
ReleaseDC(A,hdc);
MoveWindow(A,X*BCX_ScaleX,Y*BCX_ScaleY,size.cx,size.cy,TRUE);
}
return A;
}
LRESULT Set_Color (int TxtColr,int BkColr,int wParam,int lParam)
{
static HBRUSH ReUsableBrush;
DeleteObject(ReUsableBrush);
ReUsableBrush=CreateSolidBrush(BkColr);
SetTextColor((HDC)wParam,TxtColr);
SetBkColor((HDC)wParam,BkColr);
return (LRESULT)ReUsableBrush;
}
HFONT BCX_Set_Font (char *Font,int Size,int Bold,int Italic,int Underline,int StrikeThru)
{
HDC hDC=GetDC(HWND_DESKTOP);
int CyPixels=GetDeviceCaps(hDC,LOGPIXELSY);
ReleaseDC(HWND_DESKTOP,hDC);
return CreateFont(0-(Size*CyPixels)/72,0,0,0,Bold,Italic,Underline,StrikeThru,
0,OUT_TT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE,Font);
}
int qbcolor (int N)
{
switch (N)
{
case 0 : return RGB(0,0,0);
case 1 : return RGB(0,0,128);
case 2 : return RGB(0,128,0);
case 3 : return RGB(0,128,128);
case 4 : return RGB(196,0,0);
case 5 : return RGB(128,0,128);
case 6 : return RGB(128,64,0);
case 7 : return RGB(196,196,196);
case 8 : return RGB(128,128,128);
case 9 : return RGB(0,0, 255);
case 10 : return RGB(0,255,0);
case 11 : return RGB(0,255,255);
case 12 : return RGB(255,0,0);
case 13 : return RGB(255,0,255);
case 14 : return RGB(255,255,0);
case 15 : return RGB(255,255,255);
case 16 : return RGB(164,164,164);
case 17 : return RGB(128,160,255);
case 18 : return RGB(160,255,160);
case 19 : return RGB(160,255,255);
case 20 : return RGB(255,160,160);
case 21 : return RGB(255,160,255);
case 22 : return RGB(255,255,160);
case 23 : return RGB(212,212,212);
case 24 : return RGB(180,180,180);
case 25 : return RGB(188,220,255);
case 26 : return RGB(220,255,220);
case 27 : return RGB(220,255,255);
case 28 : return RGB(255,220,220);
case 29 : return RGB(255,220,255);
case 30 : return RGB(255,255,220);
case 31 : return RGB(228,228,228);
}
return 0;
}
// ************************************
// User Subs and Functions
// ************************************
void FormLoad (void)
{
Form1=BCX_Form("Alert",0,0,75,50);
Label=BCX_Label("Alert",Form1,0,0,0,75,50);
TimerID=SetTimer(Form1,1,1000,NULL);
ModStyle(Form1,0,WS_MINIMIZEBOX|WS_SIZEBOX|WS_MAXIMIZEBOX,0);
ModStyle(Label,SS_CENTER BOR SS_CENTERIMAGE);
SendMessage(Label,(UINT)WM_SETFONT,(WPARAM)BCX_Set_Font("Garamond",28),1);
Center(Form1);
Show(Form1);
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
while(1)
{
// ***************
if(Msg==WM_TIMER)
{
// ***************
if(wParam==1)
{
Change=!Change;
InvalidateRect(Label,0,TRUE);
}
// ***************
break;
}
if(Msg==WM_CTLCOLORSTATIC)
{
// ***************
if((HANDLE)lParam==Label)
{
if(Change)
{
if((HWND)lParam==Label && Msg==WM_CTLCOLORSTATIC)
return Set_Color(qbcolor(12),qbcolor(15),wParam,lParam);
}
else
{
if((HWND)lParam==Label && Msg==WM_CTLCOLORSTATIC)
return Set_Color(qbcolor(15),qbcolor(12),wParam,lParam);
}
}
// ***************
break;
}
if(Msg==WM_DESTROY)
{
// ***************
KillTimer(hWnd,1);
PostQuitMessage(0);
return 0;
// ***************
}
break;
}
if(Msg==WM_DESTROY)
{
UnregisterClass(BCX_ClassName,BCX_hInstance);
PostQuitMessage(0);
}
return DefWindowProc(hWnd,Msg,wParam,lParam);
}
Bon, ne regardons pas les apis, regarde seulement les boucles for-next, les parentheses, le parametres d'egalisation, les params de comparaisons, les if-else, c'est beaucoup de complications pour pas grand chose...
Concernant ta remarque *** Comme pour le VB, l'idéal est de faire la partie graphique en PureBasic et la partie "core" ou les parties critiques en C/C++, ce qui ne te demandera pas beaucoup plus de temps ***
Je ne sais pas vraiment si ce serait plus rapide, pureb si je ne me trompe pas genere de l'assembleur et ce language est a priori plus rapide que le C, il faudrait faire des tests a ce niveau notement avec des boucles for-next et calcul arithmetiques sur des nombres entiers, reels, je dois cependant avouer que la rapidité n'est pas mon critere personnellement, c'est plus le temps de developpement que je souhaites optimiser et le basic le permet si en plus j'ai la rapidité, tant mieux...
Pour le reste, sur internet, il y'a beaucoup de languages gratuits, perso j'ai installé dans la categorie C lcc, pellesC et Dernierement Dev C++ que j'utilisent parfois, j'ai egallement testé dev pascal (une daube par contre), sinon freepascal une alternative gratuite a delphi serait interessant si on lui ajoute l'interface lazarus, helas pour ce dernier, je ne suis pas allé loin, le fichier occupe environ 30 mo, difficile a telecharger avec mon modem 56k, je ne l'ai donc pas testé pour le moment mais sa reputation est bonne sur le web...
Depuis environ 3 ans, j'ai testé plusieurs languages, a part Le Soldat Inconnu et KarLKoX il n'y a pas beaucoup d'autres utilisateurs assez curieux pour tester d'autres languages, etes vous uniquement interessé par pureb...