Search found 118 matches

by Vortex
Aug 06, 2023 10:31
Forum: Projects
Topic: Lemonade virtual machine
Replies: 6
Views: 2010

Re: Lemonade virtual machine

Hi Dormin, I have a small problem between twinbasic and freebasic, I really wish I could combine the speed of freebasic, with the flexibility of twinbasic, but I can't in any way make them communicate with each other, the libraries created by one are not digestible for the other. FreeBASIC can outpu...
by Vortex
Aug 03, 2023 20:40
Forum: Windows
Topic: Shared or Global Variables inside a static library
Replies: 4
Views: 1577

Re: Shared or Global Variables inside a static library

This one is better :

var.bas :

Code: Select all

Common myvar as Integer

myvar=10
by Vortex
Aug 03, 2023 19:27
Forum: Windows
Topic: Shared or Global Variables inside a static library
Replies: 4
Views: 1577

Re: Shared or Global Variables inside a static library

Hello, Maybe not the best method but this is a quick test with inline assembly code : var.bas : Dim Shared myvar As Integer Asm .global myvar End Asm myvar=10 Extern myvar Alias "MYVAR" As Integer Print myvar Compiling the code : fbc32.exe -lib var.bas fbc32.exe test.bas libvar.a
by Vortex
Mar 15, 2023 17:17
Forum: Beginners
Topic: return self exe name
Replies: 8
Views: 1315

Re: return self exe name

Code: Select all

#include "windows.bi"
#include "win/shlwapi.bi"

Dim As Zstring*256 buffer

GetModuleFileName(0,@buffer,256)

PathStripPath(@buffer)

Print buffer
by Vortex
Feb 20, 2023 19:53
Forum: Windows
Topic: Starting a Windows batch script
Replies: 7
Views: 1436

Re: Starting a Windows batch script

This one should work too :

Code: Select all

#include "windows.bi"

WinExec("test.bat",SW_SHOW)
by Vortex
Feb 13, 2023 19:27
Forum: Beginners
Topic: How do I remove unnecesary VCRT code in my EXE?
Replies: 3
Views: 1151

Re: How do I remove unnecesary VCRT code in my EXE?

Hi Ben, Here is a quick example to create small executables : #include "windows.bi" #include "crt.bi" #ifdef __FB_64BIT__ #define CallConvention #else #define CallConvention Cdecl #endif Sub wmain CallConvention Alias "wmain" () Dim As Integer i For i=1 To 3 printf !&qu...
by Vortex
Aug 12, 2022 16:44
Forum: Beginners
Topic: Does FreeBasic has a main() something like?
Replies: 9
Views: 1202

Re: Does FreeBasic has a main() something like?

Here is another one : #include "windows.bi" #include "crt.bi" #ifdef __FB_64BIT__ #define CallConvention #else #define CallConvention Cdecl #endif Sub wmain CallConvention Alias "wmain" () Dim As Integer i For i=1 To 3 printf !"This is a test.\n" Next i ExitPr...
by Vortex
Jul 24, 2022 10:12
Forum: Beginners
Topic: Pointer in FB
Replies: 6
Views: 920

Re: Pointer in FB

Hello,

Why not to start by studying the latest FreeBASIC manual?

Code: Select all

FB-manual-1.09.0.chm
by Vortex
Jun 12, 2022 19:46
Forum: Beginners
Topic: 64-bit op codes in 32-bit OS
Replies: 24
Views: 2344

Re: 64-bit op codes in 32-bit OS

If you are using the 32-bit FB compiler running under 32-bit Windows 10 on an x64 processor, can you use 64-bit op codes in ASM?
Hello,

You cannot run 64-bit applications on a 32-bit Windows 10\8\7.
by Vortex
May 29, 2022 9:53
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V3.1.0 June 4, 2023)
Replies: 981
Views: 349628

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V3.0.0 May 24, 2022)

@ Kuan Hsu, thank you. I installed both, vc_redist.x86.exe and vc_redist.x64.exe. x86 works now, x64 version wants VCRUNTIME140_1.dll. What do I need to do? Edit: I have to install the newest versions of vc_redist.x86.exe and vc_redist.x64.exe (2015-2022). https://docs.microsoft.com/en-us/cpp/windo...
by Vortex
May 21, 2022 10:03
Forum: Beginners
Topic: Infinite loop -- simple trap for beginners like me
Replies: 7
Views: 1134

Re: Infinite loop -- simple trap for beginners like me

Hi fzabkar, You should get a warning message like the following : D:\FreeBASIC>fbc32 --version FreeBASIC Compiler - Version 1.09.0 (2021-12-31), built for win32 (32bit) Copyright (C) 2004-2021 The FreeBASIC development team. standalone Dim i As uByte For i = 0 To &HFF Print i, Next i fbc32 loop....
by Vortex
Apr 02, 2022 10:30
Forum: General
Topic: [SOLVED] Pass UTF-8 strings
Replies: 35
Views: 2932

Re: Pass UTF-8 strings

Hello,

You would like to check this project, UTF-8 Variable Length String Library :

viewtopic.php?t=26170
by Vortex
Mar 30, 2022 20:54
Forum: General
Topic: get application path?
Replies: 2
Views: 573

Re: get application path?

Windows API function : GetModuleFileName https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamea?redirectedfrom=MSDN Parameters [in, optional] hModule A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName ...
by Vortex
Mar 27, 2022 11:02
Forum: Beginners
Topic: Text on screen
Replies: 15
Views: 1952

Re: Text on screen

Hello,

Checking the FreeBASIC manual :

Code: Select all

Locate

Sets the current cursor position

Syntax

Declare Function Locate( row As Long = 0, column As Long = 0, state As Long = -1, start As Long = 0, stop As Long = 0 ) As Long
by Vortex
Mar 21, 2022 17:31
Forum: Beginners
Topic: [SOLVED] How to get multiple values returned from a function?
Replies: 8
Views: 4333

Re: How to get multiple values returned from a function?

Hello Laurens,
How to get multiple values returned from a function?
To return multiple values from a function, you could fill a structure ( Used Defined Type ) and return a pointer to this UDT.