# Save Data Table Value (Dialog)

Grammar — Save value as name in the scope|Global/Local data table
FlagsNative | Action

Saves a dialog value into a data table. Data tables allow you to store and recall values using a string identifier. If you save a data table value using a string identifier that already exists, you will overwrite the old value, even if it is a different data type than the value you are saving.

# Arguments

  • bool<preset::DataScope> — Scope
  • string — Name
  • int<dialog> — Value

Returns — void

native void DataTableSetDialog(
	bool global,
	string name,
	int val,
);

Category: Data Table / Save Value

# Examples

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zexpedition02.sc2map/MapScript.galaxy:2362

    lv_warpAwayProgressBar = DialogControlLastCreated();
    DialogSetVisible(lv_warpAwayBar, PlayerGroupAll(), true);
    DataTableSetDialog(true, ("Shuttle_" + IntToString(UnitGetTag(EventUnitTargetUnit()))), lv_warpAwayBar);
    while ((UnitIsAlive(EventUnitTargetUnit()) == true)) {
        DialogSetPositionRelativeToUnit(lv_warpAwayBar, EventUnitTargetUnit(), "Ref_Center", -100, -90);

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zexpedition02.sc2mapMapScript.galaxy:2362

    lv_warpAwayProgressBar = DialogControlLastCreated();
    DialogSetVisible(lv_warpAwayBar, PlayerGroupAll(), true);
    DataTableSetDialog(true, ("Shuttle_" + IntToString(UnitGetTag(EventUnitTargetUnit()))), lv_warpAwayBar);
    while ((UnitIsAlive(EventUnitTargetUnit()) == true)) {
        DialogSetPositionRelativeToUnit(lv_warpAwayBar, EventUnitTargetUnit(), "Ref_Center", -100, -90);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:4361

    lv_progressBarProgressBar = DialogControlLastCreated();
    DialogSetVisible(lv_progressBarDialog, PlayerGroupAll(), true);
    DataTableSetDialog(true, libVCUI_gf_PU_ProgressBarUnit_DialogNameOld(lp_unit, libVCUI_ge_PU_ProgressBarUnit_DialogTypesOld_ProgressBar_Dialog), lv_progressBarDialog);
    libNtve_gf_SaveDataTableValueDialogItem(true, libVCUI_gf_PU_ProgressBarUnit_DialogNameOld(lp_unit, libVCUI_ge_PU_ProgressBarUnit_DialogTypesOld_ProgressBar_Panel), lv_progressBarPanel);
    libNtve_gf_SaveDataTableValueDialogItem(true, libVCUI_gf_PU_ProgressBarUnit_DialogNameOld(lp_unit, libVCUI_ge_PU_ProgressBarUnit_DialogTypesOld_ProgressBar_ProgressBar), lv_progressBarProgressBar);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:4410

    DialogControlDestroy(lv_progressBarLabel);
    DialogDestroy(lv_progressBarDialog);
    DataTableSetDialog(true, libVCUI_gf_PU_ProgressBarUnit_DialogNameOld(lp_unit, libVCUI_ge_PU_ProgressBarUnit_DialogTypesOld_ProgressBar_Dialog), lv_noDialog);
    libNtve_gf_SaveDataTableValueDialogItem(true, libVCUI_gf_PU_ProgressBarUnit_DialogNameOld(lp_unit, libVCUI_ge_PU_ProgressBarUnit_DialogTypesOld_ProgressBar_Panel), lv_noDialogItem);
    libNtve_gf_SaveDataTableValueDialogItem(true, libVCUI_gf_PU_ProgressBarUnit_DialogNameOld(lp_unit, libVCUI_ge_PU_ProgressBarUnit_DialogTypesOld_ProgressBar_ProgressBar), lv_noDialogItem);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:3442

    lv_progressBarProgressBar = DialogControlLastCreated();
    DialogSetVisible(lv_progressBarDialog, PlayerGroupAll(), true);
    DataTableSetDialog(true, libCOUI_gf_CU_ProgressBarUnit_DialogNameOld(lp_unit, libCOUI_ge_CU_ProgressBarUnit_DialogTypesOld_ProgressBar_Dialog), lv_progressBarDialog);
    libNtve_gf_SaveDataTableValueDialogItem(true, libCOUI_gf_CU_ProgressBarUnit_DialogNameOld(lp_unit, libCOUI_ge_CU_ProgressBarUnit_DialogTypesOld_ProgressBar_Panel), lv_progressBarPanel);
    libNtve_gf_SaveDataTableValueDialogItem(true, libCOUI_gf_CU_ProgressBarUnit_DialogNameOld(lp_unit, libCOUI_ge_CU_ProgressBarUnit_DialogTypesOld_ProgressBar_ProgressBar), lv_progressBarProgressBar);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:3491

    DialogControlDestroy(lv_progressBarLabel);
    DialogDestroy(lv_progressBarDialog);
    DataTableSetDialog(true, libCOUI_gf_CU_ProgressBarUnit_DialogNameOld(lp_unit, libCOUI_ge_CU_ProgressBarUnit_DialogTypesOld_ProgressBar_Dialog), lv_noDialog);
    libNtve_gf_SaveDataTableValueDialogItem(true, libCOUI_gf_CU_ProgressBarUnit_DialogNameOld(lp_unit, libCOUI_ge_CU_ProgressBarUnit_DialogTypesOld_ProgressBar_Panel), lv_noDialogItem);
    libNtve_gf_SaveDataTableValueDialogItem(true, libCOUI_gf_CU_ProgressBarUnit_DialogNameOld(lp_unit, libCOUI_ge_CU_ProgressBarUnit_DialogTypesOld_ProgressBar_ProgressBar), lv_noDialogItem);