-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
231 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/resources/projects/advpl/files/embeddedLanguages/css.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
body { | ||
background-color: lightblue; | ||
} | ||
|
||
h1 { | ||
color: white; | ||
text-align: center; | ||
} | ||
|
||
p { | ||
font-family: verdana; | ||
font-size: 20px; | ||
} |
25 changes: 25 additions & 0 deletions
25
test/resources/projects/advpl/files/embeddedLanguages/css.prw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "Protheus.ch" | ||
//#include "tds-vscode.ch" | ||
|
||
user Function css() | ||
local myVar := "Variavel preenchida manualmente via ADVPL" | ||
local cCode | ||
|
||
BeginContent var cCode as CSS | ||
body { | ||
background-color: lightblue; | ||
} | ||
|
||
h1 { | ||
color: white; | ||
text-align: center; | ||
background-color: %Exp:myVar%; | ||
} | ||
|
||
p { | ||
font-family: verdana; | ||
font-size: 20px; | ||
} | ||
endContent | ||
|
||
return myVar |
7 changes: 7 additions & 0 deletions
7
test/resources/projects/advpl/files/embeddedLanguages/html.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<HTML> | ||
|
||
<body> | ||
<button>%Exp:myVar%</button> | ||
</body> | ||
|
||
</HTML> |
16 changes: 16 additions & 0 deletions
16
test/resources/projects/advpl/files/embeddedLanguages/html.prw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "Protheus.ch" | ||
//#include "tds-vscode.ch" | ||
|
||
user Function html() | ||
local myVar := "Variavel preenchida manualmente via ADVPL" | ||
local cCode | ||
|
||
BeginContent var cCode as HTML | ||
<HTML> | ||
<body> | ||
<button>%Exp:myVar%</button> | ||
</body> | ||
</HTML> | ||
endContent | ||
|
||
return myVar |
11 changes: 11 additions & 0 deletions
11
test/resources/projects/advpl/files/embeddedLanguages/js.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
with (document) { | ||
var data = { | ||
'From_Expression: ': '%Exp:myVar%', | ||
'name': getElementById('ID_NAME').value, | ||
'email': getElementById('ID_EMAIL').value, | ||
'date': getElementById('ID_DATE').value, | ||
} | ||
} | ||
var text = "form:SaveData('" + JSON.stringify(data) + "')"; | ||
twebchannel.jsToAdvpl('receive_data', text, 'dummy'); | ||
|
25 changes: 25 additions & 0 deletions
25
test/resources/projects/advpl/files/embeddedLanguages/js.prw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "Protheus.ch" | ||
//#include "tds-vscode.ch" | ||
|
||
user Function js() | ||
local myVar := ; | ||
"Variavel preenchida manualmente via ADVPL" | ||
local cCode | ||
|
||
|
||
beginContent var cCode as JS | ||
function sendData(){ | ||
with(document){ | ||
var data = { | ||
'From_Expression: ': %Exp:myVar%, | ||
'name':getElementById('ID_NAME').value, | ||
'email':getElementById('ID_EMAIL').value, | ||
'date':getElementById('ID_DATE').value, | ||
} | ||
} | ||
var text = "form:SaveData('" + JSON.stringify(data) + "')"; | ||
twebchannel.jsToAdvpl('receive_data', text, 'dummy'); | ||
} | ||
endContent | ||
|
||
return myVar |
10 changes: 10 additions & 0 deletions
10
test/resources/projects/advpl/files/embeddedLanguages/json.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"titulo": "JSON x XML", | ||
"resumo": "o duelo de dois modelos de representação de informações", | ||
"ano": 2012, | ||
"genero": [ | ||
"aventura", | ||
"ação", | ||
"ficção" | ||
] | ||
} |
22 changes: 22 additions & 0 deletions
22
test/resources/projects/advpl/files/embeddedLanguages/json.prw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "Protheus.ch" | ||
//#include "tds-vscode.ch" | ||
|
||
user Function json() | ||
local myVar := "Variavel preenchida manualmente via ADVPL" | ||
local cCode | ||
|
||
BeginContent var cCode as JSON | ||
{ | ||
"titulo": "JSON x XML", | ||
"resumo": "o duelo de dois modelos de representação de informações", | ||
"ano": 2012, | ||
"genero": [ | ||
"aventura", | ||
"ação", | ||
"ficção" | ||
], | ||
"myVar": %Exp:myVar% | ||
} | ||
endContent | ||
|
||
return myVar |
34 changes: 34 additions & 0 deletions
34
test/resources/projects/advpl/files/embeddedLanguages/sql.prw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "Protheus.ch" | ||
|
||
user Function sql() | ||
Local aArea := GetArea() | ||
Local cWhere := "%B1_TIPO = 'PI' AND B1_LOCPAD = '01'%" | ||
Local nRegs := 0 | ||
|
||
//Construindo a consulta | ||
BeginSql Alias "SQL_SB1" | ||
//COLUMN CAMPO AS DATE //Deve se usar isso para transformar o campo em data | ||
SELECT | ||
B1_COD, | ||
B1_DESC | ||
FROM | ||
%table:SB1% SB1 | ||
WHERE | ||
B1_FILIAL = %xFilial:SB1% | ||
AND B1_MSBLQL != '1' | ||
AND %Exp:cWhere% | ||
AND SB1.%notDel% | ||
EndSql | ||
|
||
//Enquanto houver registros | ||
While ! SQL_SB1->(EoF()) | ||
nRegs++ | ||
|
||
SQL_SB1->(DbSkip()) | ||
EndDo | ||
SQL_SB1->(DbCloseArea()) | ||
|
||
MsgInfo("Foram processados "+cValToChar(nRegs)+" produtos.", "Atenção") | ||
|
||
RestArea(aArea) | ||
Return |
10 changes: 10 additions & 0 deletions
10
test/resources/projects/advpl/files/embeddedLanguages/sql.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
SELECT | ||
B1_COD, | ||
B1_DESC | ||
FROM | ||
%table:SB1% SB1 | ||
WHERE | ||
B1_FILIAL = %xFilial:SB1% | ||
AND B1_MSBLQL != '1' | ||
AND %Exp:cWhere% | ||
AND SB1.%notDel% |
23 changes: 23 additions & 0 deletions
23
test/resources/projects/advpl/files/embeddedLanguages/ts.prw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "Protheus.ch" | ||
//#include "tds-vscode.ch" | ||
|
||
user Function ts() | ||
local myVar := ; | ||
"Variavel preenchida manualmente via ADVPL" | ||
local cCode | ||
|
||
|
||
beginContent var cCode as TS | ||
import { | ||
DocumentFormattingEditProvider, | ||
TextDocument, | ||
FormattingOptions, | ||
CancellationToken, | ||
ProviderResult, | ||
TextEdit, | ||
} from "vscode"; | ||
|
||
const myVar: string = %Exp:myVar% | ||
endContent | ||
|
||
return myVar |
10 changes: 10 additions & 0 deletions
10
test/resources/projects/advpl/files/embeddedLanguages/ts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { | ||
DocumentFormattingEditProvider, | ||
TextDocument, | ||
FormattingOptions, | ||
CancellationToken, | ||
ProviderResult, | ||
TextEdit, | ||
} from "vscode"; | ||
|
||
const myVar: string = "%Exp:myVar%" |
18 changes: 18 additions & 0 deletions
18
test/resources/projects/advpl/files/embeddedLanguages/xml.prw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "Protheus.ch" | ||
//#include "tds-vscode.ch" | ||
|
||
user Function xml() | ||
local myVar := "Variavel preenchida manualmente via ADVPL" | ||
local cCode | ||
|
||
BeginContent var cCode as XML | ||
<note> | ||
<to>Tove</to> | ||
<from>Jani</from> | ||
<heading>Reminder</heading> | ||
<body>Don't forget me this weekend!</body> | ||
<myVar>%Exp:myVar%</myVar> | ||
</note> | ||
endContent | ||
return myVar |
6 changes: 6 additions & 0 deletions
6
test/resources/projects/advpl/files/embeddedLanguages/xml.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<note> | ||
<to>Tove</to> | ||
<from>Jani</from> | ||
<heading>Reminder</heading> | ||
<body>Don't forget me this weekend!</body> | ||
</note> |