SuperObject生成示例

Posted garfieldtom

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SuperObject生成示例相关的知识,希望对你有一定的参考价值。

var
  jo,jEntity,jSubEntity: ISuperObject;
  jaOrder,jaEntity,jaSubEntity: ISuperObject;
  i,j,entityCount,subEntityCount: Integer;
begin

  entityCount:=2;
  subEntityCount:=3;

  jo := SO();
  jaEntity := SA([]);
  jaOrder :=SA([]);

  jo.S[FSampleType]:=‘‘;
  jo.S[FDate]:=‘‘;
  jo.S[FOrderNumber]:=‘‘;
  jo.S[FDeliverDate]:=‘‘;
  jo.S[FOrderTypeId]:=‘‘;
  jo.S[FSalePerson]:=‘‘;

  for I := 0 to entityCount-1 do
  begin
    jEntity := SO();
    jEntity.S[FProductId]:=IntToStr(i);
    jEntity.S[FFreeStyle]:=‘‘;
    jEntity.S[FOrderLB]:=‘‘;
    jEntity.S[FClothseSerialId]:=‘‘;
    jEntity.S[FProductUnitID]:=‘‘;
    jEntity.S[FMLMaterialID]:=‘‘;
    jEntity.S[FAuxPropId]:=‘‘;
    jEntity.S[FCustomStyle]:=‘‘;
    jEntity.S[FBrand]:=‘‘;
    jEntity.S[FRefOEMStyle]:=‘‘;
    jEntity.S[FSendSampleQty]:=‘‘;
    jEntity.S[FLeftSampleQty]:=‘‘;
    jEntity.S[FTestQty]:=‘‘;
    jEntity.S[FPreProductQty]:=‘‘;
    jEntity.S[FSpecialArtType]:=‘‘;
    jEntity.S[FWashingType]:=‘‘;

    jaSubEntity := SA([]);
    for j := 0 to subEntityCount-1 do
    begin
      jSubEntity := SO();
      jSubEntity.S[FCMaterial]:=IntToStr(j);
      jSubEntity.S[FCNumerator]:=‘‘;
      jSubEntity.S[FCUnitID]:=‘‘;

      jaSubEntity.AsArray.Add(jSubEntity);
    end;

    jEntity.O[FSubEntity]:=jaSubEntity;

    jaEntity.AsArray.Add(jEntity);
  end;

  jo.O[FEntity]:=jaEntity;

  jaOrder.AsArray.Add(jo);
  //memContent.Lines.add(jo.AsString);
  memContent.Lines.add(jaOrder.AsString);

 

以上是关于SuperObject生成示例的主要内容,如果未能解决你的问题,请参考以下文章

VS Code配置snippets代码片段快速生成html模板,提高前端编写效率

superobject

superobject使用方法

superobject 设定排序方式

Delphi7通过superobject解析JSON

delphi 使用superobject实现jsonrpc的http远程调用 good