Search found 13 matches

by objet-a
Mar 25, 2024 23:17
Forum: Archive
Topic: quitting smoking app
Replies: 3
Views: 3504

Re: quitting smoking app

I have been smoking for so long that I don't think an app would help me. I have been smoking for a big part of my life. And to be honest, I haven't been feeling so good lately. This is why I started vaping. At first, I was skeptical, but then I understood that this would do less harm to my body than...
by objet-a
Apr 26, 2022 9:13
Forum: Beginners
Topic: How to use INPUT() to read the entire content of a text document
Replies: 5
Views: 1278

Re: How to use INPUT() to read the entire content of a text document

You could try the barebones ushort pointer to handle non ascii text. This ensures you can capture wchr(0) if needed. You can overload (the subs) to handle ascii. The C runtime is needed to block load block save and handle non ascii filenames. #include "crt.bi" #include "file.bi"...
by objet-a
Apr 21, 2022 3:12
Forum: Beginners
Topic: How to use INPUT() to read the entire content of a text document
Replies: 5
Views: 1278

How to use INPUT() to read the entire content of a text document

At first, I tried using BINARY type to read, soon I canceled this idea due to unsupported set encoding type. I also tried VB code. However, it seems is not compatible with FB. Function LoadFile(ByRef filename As String,code as string="ascii") As string Dim h As Integer Dim txt As String di...
by objet-a
Apr 21, 2022 1:53
Forum: Beginners
Topic: How can I convert zstring ptr to standard string
Replies: 16
Views: 2875

Re: How can I convert zstring ptr to standard string

Split function delimiter : by default one space limit by default all the substrings (could be 1, 2,..) sub split(res() as string,strg as string,delim as string=" ",limit as integer=-1) dim as integer resmax=0 dim as integer strglen=len(strg),posinstrg=1,delimlen=len(delim),delimfound if s...
by objet-a
Apr 07, 2022 1:45
Forum: Beginners
Topic: How can I convert zstring ptr to standard string
Replies: 16
Views: 2875

How can I convert zstring ptr to standard string

I wanted to ask if there was a way to convert the two types in a way that was almost lossless in performance.
...Or tell me if have some function like VB split() .
It's painful to have no Split function in Freebasic.
by objet-a
Mar 28, 2022 9:14
Forum: Windows
Topic: [SOLVED]how to pass `char**` to c static library
Replies: 3
Views: 852

Re: how to pass `char**` to c static library

angros47 wrote: Mar 28, 2022 8:41 In FreeBasic the equivalent of "char**" is "zstring ptr ptr", not "zstring ptr"
Thanks.

Code: Select all

split(a,st,"|")
print *a[1]
After the change, it worked well.
by objet-a
Mar 28, 2022 8:11
Forum: Windows
Topic: [SOLVED]how to pass `char**` to c static library
Replies: 3
Views: 852

[SOLVED]how to pass `char**` to c static library

Static libraries can print processed data using printf() . But the main program can not read and output some confusing characters( such as 館?,\u9928\u0017 Look like memory leak). How to solve it? 1.bas Extern "C" Lib "split" Declare function split(arr as zstring ptr, str as zstri...
by objet-a
Dec 31, 2021 9:04
Forum: Sources, Examples, Tips and Tricks
Topic: freebasic custom type linked list array class
Replies: 2
Views: 1427

Re: freebasic custom type linked list array class

Possible small simplification: ..... Type VarData VString As String Ptr VDou As Double VInt As Integer 'Vptr As Any Ptr VPtr As VarData Ptr Declare Function GetType() As Short 'Declare Function GetData() AS String End Type ..... ' #define cptrz(ss) Cast(VarData Ptr, ss) ..... Sub FBArray.Add(begin ...
by objet-a
Nov 18, 2021 7:28
Forum: Sources, Examples, Tips and Tricks
Topic: freebasic custom type linked list array class
Replies: 2
Views: 1427

freebasic custom type linked list array class

I apply this class to the language I am developing test code #define UNICODE #lang "FB" #include "fbclass.inc" Dim b as FBArray b.init 10 dim ss as string ptr=New String("1") b.add(0,Type<vardata>(ss, OTHER)) dim s2 as string ptr=New String("2") b.add(1,Type<v...
by objet-a
Oct 31, 2021 10:54
Forum: Beginners
Topic: How to call a static library written in C++
Replies: 2
Views: 995

Re: How to call a static library written in C++

1.) a GNU static C/C++ lib name must end with ".a" Microsoft C/C++ used ".lib" libGetToken.a 2.) "Type Token" must be defined before first use in any declared function/sub statement. Joshy I know what you wanted to express. The "lib" is my typo error now i co...
by objet-a
Oct 31, 2021 5:44
Forum: Projects
Topic: VFB IDE【Visual Freebasic】Like vb6@5.8.11//2023-7-6
Replies: 142
Views: 59005

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2021-5-8

In fact, almost all of the VFB help file content comes from the wiki of this website, but it has been Chineseized and localized so that online help can be viewed without the Internet, which is very necessary. However, if you Englishize again, it is very difficult, because its content is all composed...
by objet-a
Oct 31, 2021 4:16
Forum: Beginners
Topic: How to call a static library written in C++
Replies: 2
Views: 995

How to call a static library written in C++

my static library:https://github.com/3XDot/GetToken.a my calling code (Minimized) 'in FF_AppStart #inclib "GetToken" '.a renamed to libGetToken.a Type Token begin As Long=0 _end As long=0 End type Extern "C++" Declare Sub match(sf As ZString Ptr,_data As Token ptr) End Extern '**...
by objet-a
Jul 13, 2021 0:30
Forum: Projects
Topic: VFB IDE document translation(2021/9/30)
Replies: 2
Views: 1624

VFB IDE document translation(2021/9/30)

Only part of it (the part written by the author) has been translated. Almost all the rest can be found on the wiki of this website https://i.loli.net/2021/07/13/6mtOM8qbS41PKVI.png . https://drive.google.com/drive/folders/1Zv1y65eUl9m4EHpvj0OIuKZj7L6D5ZqS?usp=sharing how to use 1. Download 2. Rename...