Recent Posts

Pages: [1] 2 3 ... 6
1
Apps for study and entertainment / Barra Deslizante - Autor Desconhecido
« Last post by Alex on June 29, 2020, 07:20:08 AM »
Não sei que fez este código.
Estava lá no meu backup
Code: [Select]
Var Y Integer, Valorbt Integer, rotval String

Window Size = 35, 100, Position = Center, Center, Background = RGB(237,237,237)

Image Desenho,

Image Desenho.Lin = 3
Image Desenho.Col = 2
Image Desenho.Height = 15
Image Desenho.Width = 1.6

Image Desenho.PosY = -100
Image Desenho.Img = "bt.bmp"
Valorbt = ((95-3)/192)*100

rotval = JoinStr(Valorbt," %")

Label Teste, rotval, 4, 5, 2, 25
Label Teste.BackColor = RGB(237,237,237)
Label Teste.Alignment = 2

While 1 = 1

If Image(Desenho.MouseButton) = 1
Y = Image(Desenho.MouseY)
If Y > 2 And Y < 196
Image Desenho.PosY = Y-195
Image Desenho.Img = "bt.bmp"
Valorbt = ((Y-3)/192)*100
rotval = JoinStr(Valorbt," %")
Label Teste.Txt = rotval
EndIf
EndIf 


Wait Events
Loop
EndProgram

2
Apps for study and entertainment / ABA ??
« Last post by Alex on June 27, 2020, 05:18:01 AM »
I found this code in Portuguese but do not know who did and seems is not complete, there are some bugs too,
Click aba 2 e move the mouse
Code: [Select]
Var textotab1 String, textorotaba2 String, inc Integer, part_textorotaba2 String, delay Integer
Var x1 Integer, y1 Integer, x2 Integer, y2 Integer
Var x3 Integer, y3 Integer, x4 Integer, y4 Integer
Var x5 Integer, y5 Integer, x6 Integer, y6 Integer

Button Aba1, 1, 0, 1, 10, "Aba 1"
Button Aba2, 1, 10, 1, 10, "Aba 2"
Button Aba3, 1, 20, 1, 10, "Aba 3"
'inc = 1

Button Aba1.BackColor = RGB(130,179,255)
Button Aba2.BackColor = RGB(205,224,248)
Button Aba3.BackColor = RGB(205,224,248)

' Criando a Image base (PAI) para a Aba 1

Image Aba1img
Image Aba1img.Lin = 2
Image Aba1img.Col = 0
Image Aba1img.Height = 20
Image Aba1img.Width = 50

' Desenhando Aba 1

Label rab1, "Teste de Abas", 1, 5, 3, 40
Label rab1.FontName = "Arial"
Label rab1.FontSize = 24       
Label rab1.BackColor = White
Label rab1.Alignment = 2
Label rab1.Parent = Aba1img  ' <--- Oh! O segredo!!! hahaha

textotab1 = JoinStr("   Bem vindo ao teste de Abas no Logic Basic NG!!!", Chr(13) , Chr(13) , "   O Grande segredo está em atribuir como Pai dos componentes a Image que corresponde à cada Aba. Com isso, o componente será inserido dentro da Image. Quando você movimenta a Image, você movimenta também todos os componentes inseridos dentro dela.", Chr(13), "   Ao clicar no batão Aba1, a Image correspondente é carregada na posição linha 2 x coluna 0, e as outras imagens estão em uma posição fora da nossa vista, na posição linha 3000 x coluna 3000. Quando você clica no botão referente à segunda aba, a Image da aba2 junto com seus componentes é carregada na posição 2x0 e as outras abas, 1 e 3 na posição 3000x3000. E segue-If a lógica para usar a Aba 3 ou outras abas que você inserir.", Chr(13) ,"   Simples assim!!!")
Text tab1, 4, 0, 50, 16
Text tab1.Txt = textotab1
Text tab1.Parent = Aba1img

' Criando a Image base (PAI) para a Aba 2

Image Aba2img
Image Aba2img.Lin = 3000
Image Aba2img.Col = 3000
Image Aba2img.Height = 20
Image Aba2img.Width = 50

' Desenhando Aba 2

'Label rab2, "", 0, 0, 3, 50
Label rab2.FontName = "Courier New"
Label rab2.FontSize = 10       
Label rab2.BackColor = Red
Label rab2.Alignment = 0
textorotaba2 = "Uhh!!! Aba 2 :)"
textorotaba2 = JoinStr (SeqStr(50," "),textorotaba2,SeqStr(50," "))
Label rab2.Pai = Aba2img

Button btn2aba2, 15, 20, 2, 10, "Mensagem"
Button btn2aba2.Parent = Aba2img

' Criando a Image base (PAI) para a Aba 3

Image Aba3img
Image Aba3img.Lin = 3000
Image Aba3img.Col = 3000
Image Aba3img.Height = 20
Image Aba3img.Width = 50

' Desenhando Aba 2

Image Aba3img.Use
Position 1,1
Write "Faltou criatividade :("

While 1 = 1

If TestButton = "Aba1"
Image Aba1img.Lin = 2
Image Aba1img.Col = 0
Image Aba2img.Lin = 3000
Image Aba2img.Col = 3000
Image Aba3img.Lin = 3000
Image Aba3img.Col = 3000
Button Aba1.BackColor = RGB(130,179,255)
Button Aba2.BackColor = RGB(205,224,248)
Button Aba3.BackColor = RGB(205,224,248)
TestButton = ""
EndIf

If TestButton = "Aba2"
Image Aba1img.Lin = 3000
Image Aba1img.Col = 3000
Image Aba2img.Lin = 2
Image Aba2img.Col = 0
Image Aba3img.Lin = 3000
Image Aba3img.Col = 3000
Button Aba1.BackColor = RGB(205,224,248)
Button Aba2.BackColor = RGB(130,179,255)
Button Aba3.BackColor = RGB(205,224,248)
TestButton = ""
EndIf

If TestButton = "Aba3"
Image Aba1img.Lin = 3000
Image Aba1img.Col = 3000
Image Aba2img.Lin = 3000
Image Aba2img.Col = 3000
Image Aba3img.Lin = 2
Image Aba3img.Col = 0
Button Aba1.BackColor = RGB(205,224,248)
Button Aba2.BackColor = RGB(205,224,248)
Button Aba3.BackColor = RGB(130,179,255)
TestButton = ""
EndIf

If TestButton = "btn2aba2"
Message "M E N S A G E M",Chr(13),"E",Chr(13),"N",Chr(13),"S",Chr(13),"A",Chr(13),"G",Chr(13),"E",Chr(13),"M"
TestButton = ""
EndIf


' Label If movimentando na Aba 2
' ps.: Sei que você queriam saber como funciona...
delay = 0
delay++
If delay = 20
delay = 0
inc++
EndIf
If inc = 70
inc = 1
EndIf
'part_textorotaba2 = SubStr(textorotaba2,inc++, 50)
'part_textorotaba2 = SubStr(textorotaba2,2, 50)
Label rab2.Txt = part_textorotaba2


Image Aba2img.Cls
x1 = Image(Aba2img.MouseX)
y1 = Image(Aba2img.MouseY)
x2 = Random(20)
x2 = x2 - 10
x2 = x1+x2
x3 = Random(20)
x3 = x3 - 10
x3 = x2+x3
y2 = Random(20)
y2 = y2 - 10
y2 = y1+y2
y3 = Random(20)
y3 = y3 - 10
y3 = y2+y3

x4 = Image(Aba2img.MouseX)
y4 = Image(Aba2img.MouseY)
x5 = Random(20)
x5 = x5 - 10
x5 = x4+x5
x6 = Random(20)
x6 = x6 - 10
x6 = x5+x6
y5 = Random(20)
y5 = y5 - 10
y5 = y4+y5
y6 = Random(20)
y6 = y6 - 10
y6 = y5+y6

Image Aba2img.Straight, x1, y1, x2, y2, Red
Image Aba2img.Straight, x2, y2, x3, y3, Red
Image Aba2img.Straight, x4, y4, x5, y5, Red
Image Aba2img.Straight, x5, y5, x6, y6, Red

Wait Events
Loop
3
Discussions about Logic Basic / Bug in Function ?????
« Last post by Alex on June 24, 2020, 07:27:35 PM »
In my computer both code do not run weel, with strangers messages

Align Strings
Code: [Select]
Var Test String
Test = Alinha("123,50",20)
Write "[", Test, "]"
Test = Alinha("1.523,50",20)
Write "[", Test, "]"
EndProgram

Function Alinha(S String, T Integer) String
Var StrAlinha String, Str String, Comp Integer
StrAlinha = S
Message "Aqui S = ",S," e StrAlinha = ",StrAlinha
Comp = StrLen(S)
 If T < Comp
  Return StrAlinha
 Else
  T = T - Comp
  Str = (SeqStr(T,".")
  Message "Aqui Str = ",Str," e S = ",S
  StrAlinha = JoinStr(Str,S)
  Return StrAlinha
 EndIf 
EndFunction


test I did
Code: [Select]
Var str1 String, str2 String, str3 String, str4 String
Var T Integer
str1 = "Ola"
str2 = " mundo"
str3 = JoinStr(str1,str2)
Write str3
str4 = Join(str2,str1)
Write str4
T = Sum(5, 2)
Write "The value of the sum of 5 + 2 is equals to ", T
Wait 3000
EndWindow
EndProgram


Function Join(s1 String, s2 String) String
Var st String
Message s1,s2
st = JoinStr(s1,s2)
Return st
EndFunction

Function Sum(X Integer, Y Integer) Integer
Var Ret Integer, V Integer
Ret = X + Y
Return Ret
EndFunction
4
Apps for study and entertainment / Hangman by Colares
« Last post by Alex on June 19, 2020, 06:27:14 AM »
Below thecode and elements for a hangman game developed by Colares that I found in my folders, is a different logorithm for the code

https://www.4shared.com/rar/oipeYwnxiq/HangmanColares.html
5
Discussions about Logic Basic / Command Copy
« Last post by Alex on June 18, 2020, 10:56:26 AM »
I do not got sucess trying to copy a file.lbf from a path Programdir\date to to another programdir\backup
Somebody have a code or how to do a backup DB
18/06/20 I got it, just close db

Code: [Select]
'this not work

Var file1 String
Var file2 String
 
File1 = JoinStr(ProgramDir,"\date\File.lbf")
Message "Caminho do File1 = ",File1
File2 = JoinStr(ProgramDir,"\Backup\File.lbf")
Message "Caminho do File2 = ",File2
CloseDb File
Copy File1,File2

6
Discussions about Logic Basic / API Guide
« Last post by Alex on June 17, 2020, 06:59:34 AM »
See attached the guide I have used for API Logic Basic.
I don´t know if every command works in LB

https://www.4shared.com/rar/UQvTubZpba/VbApiGuide.html
7
Apps for study and entertainment / Hangman
« Last post by Alex on June 17, 2020, 06:32:49 AM »
Attached code and some sounds
Belown link for download, complete gifs sounds

https://www.4shared.com/rar/Q2K7eOZRiq/hangman.html
8
Discussions about Logic Basic / Bug Button BackColor
« Last post by Alex on June 12, 2020, 10:13:46 AM »
When you set a window Background seems this is also the Button BackColor
If you don´t set a Window Backcolor the Button BackColor don´t work

Code: [Select]

Window Border = False
Window Size = 20, 90
Window Pos = Center, Center
Window Background = Green ' this will be the Button Backcolor


 Button BtnSairCad,2,2,2,14,"Sair"
 Button BtnSairCad.BackColor=Black
 Button BtnSairCad.ForeColor=Red
 Button BtnSairCad.FontName="Comic Sans MS"
 Button BtnSairCad.FontSize=17
 
While 1 = 1
Wait 1
 Wait ClickButton
 If RetStr = "BtnSairCad"
  EndWindow
 EndIf
Loop
EndSub
9
Apps for study and entertainment / Star Wars Introduction
« Last post by Alex on June 10, 2020, 06:41:43 AM »
I trying to do that text flyind in space from Star Wars film, it´s an ideia to use in game, but a can´t find a way to keep the text align, if somebody have an ideia. ( the sound mp3  was to big file to attached"

Code: [Select]
Var E1 Decimal,E2 Decimal,E3 Decimal,E4 Decimal,E5 Decimal,E6 Decimal,E7 Decimal,E8 Decimal,
Var E9 Decimal,E10 Decimal,E11 Decimal,E12 Decimal,E13 Decimal,E14 Decimal,E15 Decimal
Var E16 Decimal,E17 Decimal

Var D1 Decimal

Var N1 Decimal, N2 Decimal, N3 Decimal, N4 Decimal, N5 Decimal, N6 Decimal, N7 Decimal, N8 Decimal,
Var N9 Decimal, N10 Decimal, N11 Decimal, N12 Decimal, N13 Decimal, N14 Decimal, N15 Decimal,
Var N16 Decimal, N17
Var N1 Decimal, N2 Decimal, N3 Decimal, N4 Decimal

Var TF1 Decimal,TF2 Decimal,TF3 Decimal,TF4 Decimal,TF5 Decimal,TF6 Decimal
Var TF7 Decimal,TF8 Decimal,TF9 Decimal,TF10 Decimal,TF11 Decimal,TF12 Decimal,TF13 Decimal
Var TF14 Decimal,TF15 Decimal,TF16 Decimal,TF17 Decimal

Var X1 Decimal, Y1 Decimal,X2 Decimal, Y2 Decimal,X3 Decimal, Y3 Decimal,X4 Decimal, Y4 Decimal,
Var X5 Decimal, Y5 Decimal,X6 Decimal, Y6 Decimal,X7 Decimal, Y7 Decimal,X8 Decimal, Y8 Decimal,
Var X9 Decimal, Y9 Decimal,X10 Decimal, Y10 Decimal,X11 Decimal, Y11 Decimal,X12 Decimal, Y12 Decimal,
Var X13 Decimal, Y13 Decimal,X14 Decimal, Y14 Decimal,X15 Decimal, Y15 Decimal,X16 Decimal, Y16 Decimal,X17 Decimal, Y17 Decimal,

Var T1 String, T2 String, T3 String, T4 String,T5 String, T6 String, T7 String, T8 String, T9 String
Var T10 String,T11 String, T12 String, T13 String, T14 String, T15 String, T16 String, T17 String,T18 String


T1 =  "          Numa galaxia muito distante"
T2 =  "    Havia um Ogro chamado Sherek o terrivel"
T3 =  "     Mas ele era muito inteligente e sábio"
T4 =  "  Um dia lhe perguntaram como ganhar muito dinheiro"
T5 =  "        Ele pensou durante um tempo e disse"
T6 =  " Se voce tentar andar por cima da água com um remo só"
T7 =  "      vai entender que em casa de cachorro"
T8 =  "             cavalo tem dois rabos"
T9 =  "             e cobra duas orelhas "
T10 = "            Ao decifrar este enigma"
T11 = "             Maionese com Pimenta"
T12 = "           é shampoo para tartaruga"
T13 = "           Pague as contas em dia"
T14 = "         Pule sete ondas de 8 metros"
T15 = "                 e pronto"
T16 = "          Voce vai perceber que"
T17 = "      só perdeu tempo lendo isso tudo"

N1=3.4
N2=20
N3=20
N4=20
N5=20
N6=20
N7=20
N8=20
N9=20
N10=20
N11=20
N12=20
N13=20
N14=20
N15=20
N16=20
N17=20

D1 = 0.8

TF1 = 12
TF2 = 12
TF3 = 12
TF4 = 12
TF5 = 12
TF6 = 12
TF7 = 12
TF8 = 12
TF9 = 12
TF10 = 12
TF11 = 12
TF12 = 12
TF13 = 12
TF14 = 12
TF15 = 12
TF16 = 12
TF17 = 12

E1=0.1
E2=0.1
E3=0.1
E4=0.1
E5=0.1
E6=0.1
E7=0.1
E8=0.1
E9=0.1
E10=0.1
E11=0.1
E12=0.1
E13=0.1
E14=0.1
E15=0.1
E16=0.1
E17=0.1

X1 = 80; Y1 = 290
X2 = 80; Y2 = 310
X3 = 80; Y3 = 330
X4 = 80; Y4 = 350
X5 = 80; Y5 = 370
X6 = 80; Y6 = 390
X7 = 80; Y7 = 410
X8 = 80; Y8 = 430
X9 = 80; Y9 = 450
X10 = 80; Y10 = 470
X11 = 80; Y11 = 490
X12 = 80; Y12 = 510
X13 = 80; Y13 = 530
X14 = 80; Y14 = 550
X15 = 80; Y15 = 570
X16 = 80; Y16 = 590
X17 = 80; Y17 = 610

Window Size = 20, 80
'Sound SW,"SW.mp3"

Image Desenho
Image Desenho.Lin = 0; Image Desenho.Col = 0
Image Desenho.Height = 22; Image Desenho.Width = 80
Image Desenho.Parent = "Sobre"

'Som SW.Tocar
While 1 = 1

Image Desenho.Write ""
Image Desenho.FontSize = TF1
Image Desenho.PosX = X1
Image Desenho.PosY = Y1
Image Desenho.Write T1

Image Desenho.FontSize = TF2
Image Desenho.PosX = X2
Image Desenho.PosY = Y2
Image Desenho.Write T2

Image Desenho.FontSize = TF3
Image Desenho.PosX = X3
Image Desenho.PosY = Y3
Image Desenho.Write T3

Image Desenho.FontSize = TF4
Image Desenho.PosX = X4
Image Desenho.PosY = Y4
Image Desenho.Write T4

Image Desenho.FontSize = TF5
Image Desenho.PosX = X5
Image Desenho.PosY = Y5
Image Desenho.Write T5

Image Desenho.FontSize = TF6
Image Desenho.PosX = X6
Image Desenho.PosY = Y6
Image Desenho.Write T6

Image Desenho.FontSize = TF7
Image Desenho.PosX = X7
Image Desenho.PosY = Y7
Image Desenho.Write T7

Image Desenho.FontSize = TF8
Image Desenho.PosX = X8
Image Desenho.PosY = Y8
Image Desenho.Write T8

Image Desenho.FontSize = TF9
Image Desenho.PosX = X9
Image Desenho.PosY = Y9
Image Desenho.Write T9

Image Desenho.FontSize = TF10
Image Desenho.PosX = X10
Image Desenho.PosY = Y10
Image Desenho.Write T10

Image Desenho.FontSize = TF11
Image Desenho.PosX = X11
Image Desenho.PosY = Y11
Image Desenho.Write T11

Image Desenho.FontSize = TF12
Image Desenho.PosX = X12
Image Desenho.PosY = Y12
Image Desenho.Write T12

Image Desenho.FontSize = TF13
Image Desenho.PosX = X13
Image Desenho.PosY = Y13
Image Desenho.Write T13

Image Desenho.FontSize = TF14
Image Desenho.PosX = X14
Image Desenho.PosY = Y14
Image Desenho.Write T14

Image Desenho.FontSize = TF15
Image Desenho.PosX = X15
Image Desenho.PosY = Y15
Image Desenho.Write T15

Image Desenho.FontSize = TF16
Image Desenho.PosX = X16
Image Desenho.PosY = Y16
Image Desenho.Write T16

Image Desenho.FontSize = TF17
Image Desenho.PosX = X17
Image Desenho.PosY = Y17
Image Desenho.Write T17

Y1=Y1-N1
N1=N1-0.02
If N1<0.1
 N1=0.1
EndIf
If Y1<280
 TF1=TF1-E1
 If TF1<2
  TF1=3
 EndIf
 X1=X1+D1
EndIf   

Y2=Y1+N2
N2=N2-0.1
If N2<0.1
 N2=0.1
EndIf
If Y2<280
 TF2=TF2-E2
 If TF2<2
  TF2=3
 EndIf
 X2=X2+D1
EndIf

Y3=Y2+N3
N3=N3-0.1
If N3<0.1
 N3=0.1
EndIf
If Y3<280
 TF3=TF3-E3
 If TF3<2
  TF3=3
 EndIf
X3=X3+D1
EndIf

Y4=Y3+N4
N4=N4-0.1
If N4<0.1
 N4=0.1
EndIf
If Y4<280
 TF4=TF4-E4
 If TF4<2
  TF4=3
 EndIf
 X4=X4+D1
EndIf

Y5=Y4+N5
N5=N5-0.1
If N5<0.1
 N5=0.1
EndIf
If Y5<280
 TF5=TF5-E5
 If TF5<2
  TF5=3
 EndIf
 X5=X5+D1
EndIf

Y6=Y5+N6
N6=N6-0.1
If N6<0.1
 N6=0.1
EndIf
If Y6<280
 TF6=TF6-E3
 If TF6<2
  TF6=3
 EndIf
 X6=X6+D1
EndIf

Y7=Y6+N7
N7=N7-0.1
If N7<0.1
 N7=0.1
EndIf
If Y7<280
 TF7=TF7-E7
 If TF7<2
  TF7=3
 EndIf
 X7=X7+D1
EndIf

Y8=Y7+N8
N8=N8-0.1
If N8<0.1
 N8=0.1
EndIf
If Y8<280
 TF8=TF8-E8
 If TF8<2
  TF8=3
 EndIf
 X8=X8+D1
EndIf

Y9=Y8+N9
N9=N9-0.1
If N9<0.1
 N9=0.1
EndIf
If Y9<280
 TF9=TF9-E9
 If TF9<2
  TF9=3
 EndIf
 X9=X9+D1
EndIf

Y10=Y9+N10
N10=N10-0.1
If N10<0.1
 N10=0.1
EndIf
If Y10<280
 TF10=TF10-E10
 If TF10<2
  TF10=3
 EndIf
 X10=X10+D1
EndIf

Y11=Y10+N10
N11=N11-0.1
If N11<0.1
 N11=0.1
EndIf
If Y11<280
 TF11=TF11-E11
 If TF11<2
  TF11=3
 EndIf
 X11=X11+D1
EndIf

Y12=Y11+N12
N12=N12-0.1
If N12<0.1
 N12=0.1
EndIf
If Y12<280
 TF12=TF12-E12
 If TF12<2
  TF12=3
 EndIf
 X12=X12+D1
EndIf

Y13=Y12+N13
N13=N13-0.1
If N13<0.1
 N13=0.1
EndIf
If Y13<280
 TF13=TF13-E13
 If TF13<2
  TF13=3
 EndIf
 X13=X13+D1
EndIf

Y14=Y13+N14
N14=N14-0.1
If N14<0.1
 N104=0.1
EndIf
If Y14<280
 TF14=TF14-E14
 If TF14<2
  TF14=3
 EndIf
 X14=X14+D1
EndIf

Y15=Y14+N15
N15=N15-0.1
If N15<0.1
 N15=0.1
EndIf
If Y15<280
 TF15=TF15-E15
 If TF15<2
  TF15=3
 EndIf
 X15=X15+D1
EndIf

Y16=Y15+N16
N16=N16-0.1
If N16<0.1
 N16=0.1
EndIf
If Y16<280
 TF16=TF16-E16
 If TF16<2
  TF16=3
 EndIf
 X16=X16+D1
EndIf

Y17=Y16+N17
N17=N17-0.1
If N17<0.1
 N17=0.1
EndIf
If Y17<280
 TF17=TF17-E17
 If TF17<2
  TF17=3
 EndIf
 X17=X17+D1
EndIf

Wait 500
Image Desenho.Cls
Loop
10
Discussions about Logic Basic / Bug Rep.end
« Last post by Alex on June 10, 2020, 06:33:39 AM »
I've compiled 3 codes that use rep command , the code in software LB run ok , but the exe file show a message, see atachement.
Pages: [1] 2 3 ... 6