Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about "Sub memcpy ..."
#1
While reading the wiki I came across Offset(function): https://qb64phoenix.com/qb64wiki/index.p...(function)

The sub "memcpy" is apparently a fixed procedure, because when I changed the name there was an error during compilation.
What is this "memcpy"? Hard-wired?  I couldn't find anything about it in the wiki.

Code: (Select All)

Option _Explicit

Declare CustomType Library
  Sub zeichenKopieren (ByVal Ziel As _Offset, Byval Quelle As _Offset, Byval Bytes As Long)
End Declare

Dim As String zahlen, buchstaben

zahlen = "1234567890"
buchstaben = "ABCDEFGHIJ"

zeichenKopieren _Offset(zahlen) + 5, _Offset(buchstaben) + 5, 5
Print zahlen

End

Quote:internal\c\c_compiler\bin\c++.exe -Wl,--stack,26777216 -std=gnu++17 -fno-strict-aliasing -Wno-conversion-null -DGLEW_STATIC -DFREEGLUT_STATIC -Iinternal\c\libqb/include -Iinternal\c/parts/core/freeglut/include -Iinternal\c/parts/core/glew/include -DDEPENDENCY_NO_SOCKETS -DDEPENDENCY_NO_PRINTER -DDEPENDENCY_NO_ICON -DDEPENDENCY_NO_SCREENIMAGE internal\c/qbx.cpp -c -o internal\c/qbx.o
In file included from internal\c/qbx.cpp:1894:
internal\c/../temp/maindata.txt: In function 'void QBMAIN(void*)':
internal\c/../temp/maindata.txt:1:55: error: 'zeichenKopieren' was not declared in this scope
    1 | SUB_ZEICHENKOPIEREN=(CUSTOMCALL_SUB_ZEICHENKOPIEREN*)&zeichenKopieren;
      |                                                      ^~~~~~~~~~~~~~~
mingw32-make: *** [Makefile:402: internal\c/qbx.o] Error 1
That is OK.
Code: (Select All)

'12. Juli 2024

Option _Explicit

Declare CustomType Library
  Sub memcpy (ByVal Ziel As _Offset, Byval Quelle As _Offset, Byval Bytes As Long)
End Declare

Dim As String zahlen, buchstaben

zahlen = "1234567890"
buchstaben = "ABCDEFGHIJ"

memcpy _Offset(zahlen) + 5, _Offset(buchstaben) + 5, 5
Print zahlen

End
Reply


Messages In This Thread
Question about "Sub memcpy ..." - by Kernelpanic - 07-12-2024, 05:26 PM
RE: Question about "Sub memcpy ..." - by Pete - 07-12-2024, 05:36 PM
RE: Question about "Sub memcpy ..." - by SMcNeill - 07-12-2024, 06:50 PM



Users browsing this thread: 1 Guest(s)