Product Home
DTM Data Generation SDK Online Documentation
Product Profile
SDK components
Functions map
Low level API
Short Random
Integer Random
Random Symbol
Double Random
Random String
Random Date
Random Time
C/C++ example
Fill Methods level API
From list
From file
From table
From Values Library
Incremental
By maks
By SQL statement
Rule level API
Rule properties
Rule items
One rule item
Project level API
Project operations
Project properties
Project rules
Object handles
Database connection
Error handling
SDK limitations
Build application with SDK
License agreement

Generate Values from list

List Initialization
C/C++
DG_HANDLE InitList(int values, char *list[])
values - number of values the list;
list - array of strings for list's content.

Generate value
C/C++
char *ListValue(DG_HANDLE handle, int sequentially)

C#
string ListValue(int handle, int sequentially)
Not 0 'sequentially' value means the function will return values from the list sequentially, random otherwise.

Example

C/C++
#include "../dgsdkdefs.h"
#include <stdio.h>

int main()
{
	int i;
	char *list[] = {"a10","a20","a30","a40","a50","a60","a70","a80","a90","a100",
			"b10","b20","b30","b40","b50","b60","b70","b80","b90","b100"};
	char buf1[5],buf2[5];
	DG_HANDLE	handle = InitList(20,list);

	if(handle==0)
		printf("Coild not allocate Handle for Fill Method\n");
	else 
	{
		printf("Line\tValue Random\tValue Sequential\n");
		for(i=0; i<20; i++)
		{
			strcpy(buf1,ListValue(handle,0));
			strcpy(buf2,ListValue(handle,1));
			printf("%d\t%s\t%s\n",i+1,buf1,buf2);
		}
		CloseH(handle);
	}
}