sábado, 27 de fevereiro de 2016

Curso WinDev - Array - 002 - Quantas Ocorrencias Array






Video Youtube

 


Nesse video vou mostrar como saber quantos array existem

In this video I will show how to know how many there are array

Dans cette vidéo, je vais vous montrer comment savoir combien il y en réseau


http://doc.pcsoft.fr/fr-FR/?1514030&name=tableau_type_variable
http://doc.windev.com/en-US/?1514030&name=Simple_arrays


WinDev - Array - 001/... Adiciona/Classifica Ordem/Mostra
WinDev - Array - 002/... Quantas Ocorrencias Array
WinDev - Array - 003/... ArrayDeleteLine - Eliminha uma Linha do Array
WinDev - Array - 004/... ArrayToString



//Quantos Array
n_quantos_array is int=tabListanumeros..Occurrence

Info("Tem "+n_quantos_array+" Array")

//Frances
n_quantos_array_f est entier=tabListanumeros..Occurrence


tabListanumeros is array of 0 int

ArrayAddLine(tabListanumeros,10)
ArrayAddLine(tabListanumeros,5)
ArrayAddLine(tabListanumeros,2)
ArrayAddLine(tabListanumeros,20)
ArraySort(tabListanumeros,asAscending)
FOR x=1 TO ArrayCount(tabListanumeros)
    SAI_array+=tabListanumeros[x]+CR
END
////Frances
//tabListanumeros_f est tableau de 0 entier
//TableauAjouteLigne(tabListanumeros_f,10)
//TableauAjouteLigne(tabListanumeros_f,5)
//TableauAjouteLigne(tabListanumeros_f,2)
//TableauAjouteLigne(tabListanumeros_f,20)
//TableauTrie(tabListanumeros_f,ttCroissant)
//POUR x=1 A TableauOccurrence(tabListanumeros_f)
//    SAI_array+=tabListanumeros_f[x]+RC
//FIN
























WinDev - Enviar email com HTML personalizado




// Summary: <specify the procedure action>
// Syntax:
//EnviaMail ()
//
// Parameters:
// None
// Return Value:
// None
//
// For instance:
// Indicate an example.
//
Procedure EnviaMail()

UserName is string
UserName = "reservas@empresa.com"

IF EmailStartSMTPSession(UserName, "sua senha aqui", ...
"ssd.serversecureplusplusalekito.net",465, False,optionSSL) = True THEN

Destinatario, Assunto, sAnexo is string

Destinatario = "Reservas@empresa.com"
Assunto = "Nueva Reserva en el sitio web de : (" + EDT_Nombre + ")"

Corpo is string =[
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Email</title>
</head>
<body>
<span style="font-weight: bold;">Detalles de la Reserva<br>
</span>
<table
style="text-align: left; background-color: rgb(102, 204, 204); width: 360px; height: 284px;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td><span style="font-weight: bold;"> <span
style="color: white;">Nombre :</span> </span></td>
<td><span style="font-weight: bold;"><span
style="color: white;">%1</span> </span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Correo:  </span></td>
<td style="color: white;"><span
style="font-weight: bold;">%2</span></td>
</tr>
<tr>
<td><span style="font-weight: bold;"><span
style="color: white;">Teléfono:</span> </span></td>
<td style="color: white;"><span
style="font-weight: bold;"> %3</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Fehca Viaje:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%4</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Hora Viaje :</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%5</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Origem: </span></td>
<td style="color: white;"><span
style="font-weight: bold;"> %6</span></td>
</tr>
<tr>
<td><span style="font-weight: bold;"><span
style="color: white;">Destino:  </span> </span></td>
<td style="color: white;"><span
style="font-weight: bold;">%7</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Total Adultos:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%8</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Total de Niños:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%9</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Observaciones:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">% 10</span></td>
</tr>
</tbody>
</table>
<span style="font-weight: bold;"><br>
<br>
<br>
</span><span style="font-weight: bold;">Sistema d</span><span
style="font-weight: bold;"></span><span
style="font-weight: bold;">e reservas en linea Transmacuchi</span><br>
<span style="font-weight: bold;"><img
style="width: 139px; height: 129px;" alt="Transmacuchi"
title="Logo"
src="http://www.transmacuchi.com/efactura_web/es/index.awp?WD_ACTION_=IMAGE&M31=2&AWPID=AF8FBAFC4226C77C51ECF7A72A7E5E5C01D08187"></span><span
style="font-weight: bold;"></span><span
style="font-weight: bold;"></span>
</body>
</html>

]

MyArray is array of 10 string
MyArray[1] = EDT_Nombre
MyArray[2] = EDT_MAIL
MyArray[3] = EDT_TEL
MyArray[4] = DateToString(EDT_FECHA,"DD/MM/YYYY")
MyArray[5] = TimeToString(EDT_HORA,"HH:MM:SS")
MyArray[6] = COMBO_ORIGEN..StoredItem
MyArray[7] = COMBO_DESTINO..StoredItem
MyArray[8] = COMBO_ALDULTOS..StoredItem
MyArray[9] = COMBO_NINOS..StoredItem
MyArray[10] = EDT_OBSERV


Mensaje is string = StringBuild(Corpo,MyArray)


//INICIA A ESTRUTURA DO E-MAIL
MonMessage est un Email
MonMessage..Expediteur = "reservas@empresa.com"
Ajoute(MonMessage..Destinataire, Destinatario)

MonMessage..HTML = Mensaje
MonMessage..AccuséRéception = Vrai
MonMessage..Sujet = Assunto

IF sAnexo <> " " THEN
//EmailLoadAttachment(MonMessage,Anexo)
END

//ENVIA O E-MAIL
IF EmailSendMessage(UserName, MonMessage) = False THEN
Error()
ELSE
Info("Mensaje enviada con suceso!")
END





EmailCloseSession(UserName)

ELSE

Error("Unable to establish connection", ErrorInfo(), ...
"In case of time-out, check the parameters of the "+ ...
"""Firewall"" on the port used (587)")
END


http://forum.pcsoft.fr/pt-BR/pcsoft.br.windev/960-enviar-email-com-html-personalizado/read.awp

http://www.kompozer.net/ 






















Executar (Abrir) outro aplicativo Android.




//ExecRun

import android.app.Activity;
import android.content.Intent;
import java.lang.*;
import android.util.*;
import java.lang.Exception;
import android.util.Log;

PUBLIC static boolean ExecRun(string Aplicativo){
try {

IF (Aplicativo == null){
RETURN False;
}
ELSE{
Intent Apk = getActiviteEnCours().getPackageManager().getLaunchIntentForPackage(Aplicativo);
getActiviteEnCours().startActivity(Apk);
RETURN True;
}

}
catch(EXCEPTION e) {
Log.e("WM",e.toString());
RETURN False;
}
}


http://forum.pcsoft.fr/pt-BR/pcsoft.br.windev/966-exemplos-uso-codigos-java-android-nativo-para-suas/read.awp















WM - Tocar, executar um arquivo MP3 via java no projeto Android do Windev Mobile (Play Mp3 in project Android with Windev Mobile




/CODE JAVA IN WINDEV MOBILE

import android.media.MediaPlayer;

PUBLIC static void ExecMp3(string filePath)
{
try {
MediaPlayer mediaPlayer = new MediaPlayer();
mediaPlayer.setDataSource(filePath);
mediaPlayer.prepare();
mediaPlayer.start();
} catch (EXCEPTION ex) {

}

}



ExecMp3("arquivo.mp3")


http://forum.pcsoft.fr/pt-BR/pcsoft.br.windev/987-tocar-executar-arquivo-mp3-via-java-projeto-android/read.awp










WM - Java Android GPS ON/OFF com Windev Mobile




//BroadcastReceiver GPS_On

import android.app.Activity;
import java.lang.*;
import android.util.*;
import java.lang.Exception;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

PUBLIC static void GPS_On()
{
Intent intent=new Intent("android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", True);
getActiviteEnCours().sendBroadcast(intent);
}


GPS_On()


//BroadcastReceiver GPS_Off

import android.app.Activity;
import java.lang.*;
import android.util.*;
import java.lang.Exception;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

PUBLIC static void GPS_Off()
{
Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", False);
getActiviteEnCours().sendBroadcast(intent);
}


GPS_Off()









Teste

Teste
teste